digitalsparky / jekyll-minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
GNU General Public License v3.0
245 stars 25 forks source link

Respect jekyll.environment to disable minification #40

Closed patrickfav closed 5 years ago

patrickfav commented 6 years ago

So I am aware you could use different configs for development, but this is really a unsatisfactory solution, since I have to maintain (copy+paste) 2 configs and the commands get more complicated (ie. needlessly increases development complexity).

So I propose using the convention variable jekyll.environment to determine if minification should occur. According to the jekyll docs the jekyll.environment is set to developmentper default. To set it to production one does:

JEKYLL_ENV=production bundle exec jekyll build -t

To support flexibility a new option could be introduced:

jekyll-minifier:
  disable_minify_in_development: true

If true, only minifiy if jekyll.environment != 'development', if false - behavior as before.

This relates to #30 and #12.

btw. thanks for the great plugin ❤️

patrickfav commented 6 years ago

Btw. it seems the only possibility to disable the plugin is to add

jekyll-minifier:
  exclude: '**.*'
digitalsparky commented 5 years ago

Fixed in 0.1.8.