tkareine / jekyll-minibundle

A minimalistic asset bundling plugin for Jekyll
MIT License
68 stars 9 forks source link

Two questions: cache and specifying bundlers in _config.yml ? #4

Closed phillipadsmith closed 10 years ago

phillipadsmith commented 10 years ago

Two quick questions:

  1. I'm wondering if you're planning to add some caching to jekyll-minibundle similar to what https://github.com/moshen/jekyll-asset_bundler does currently? It seems to speed up the build dramatically if nothing has changed for the to-be-bundled files?
  2. Also, curious if you're planning to add option to specify the JS or CSS minifier command in the _config.yml?

Many thanks,

Phillip.

tkareine commented 10 years ago

I'm wondering if you're planning to add some caching to jekyll-minibundle similar to what https://github.com/moshen/jekyll-asset_bundler does currently? It seems to speed up the build dramatically if nothing has changed for the to-be-bundled files?

Do you mean that when running jekyll build command many times in succession the plugin would run the bundling command only when the bundle sources have changed and otherwise reuse the previous bundling result? In this case, there would be a cache directory for bundles and the plugin would just copy the cached bundle file to the site output directory when the bundle's source files are unchanged.

I can imagine that to speed up site generation. However, I think the implementation would add some hairy complexity to the plugin, including configuration for enabling or disabling the feature and keeping track of the used bundling command. I hope to balance having the plugin simple but useful. How long does it take to bundle the assets in your case and what's the total time for site generation?

Also, curious if you're planning to add option to specify the JS or CSS minifier command in the _config.yml?

The plugin's design avoids global configuration intentionally. I didn't think bundling command configurations for JS and CSS assets were reason enough to touch the _config.yml file, especially when the plugin's development mode switch is a natural fit for an environment variable.

So, there are no plans to support configuration via _config.yml for now, but I'm open to feedback. Would configuration with _config.yml be more natural and would it help maintaining your site?

phillipadsmith commented 10 years ago

How long does it take to bundle the assets in your case and what's the total time for site generation?

Currently, it's fairly quick, to be honest.

The plugin's design avoids global configuration intentionally.

Just seemed odd to me to need to set the $JEKYLL_MINIBUNDLE_CMD_JS environmental variable, given that it would then again need to be re-set in any other environments where this is used. Whereas, setting the path to the binary could be done in the _config.yml and that would be carried along with the project.

Anyway, just two cents.

tkareine commented 10 years ago

setting the path to the binary could be done in the _config.yml and that would be carried along with the project.

I agree. Version 1.5.0 of the plugin supports reading the minifier command from _config.yml, along with other related changes. The details are in CHANGELOG and README.

phillipadsmith commented 10 years ago

:+1: