Naftuli Kay Naftuli Kay - 3 months ago 18
Sass (Sass) Question

Compress SASS output based on JEKYLL_ENV?

I have a static site setup with Jekyll. I'm compiling multiple SCSS files into a single

output file.

In local development, I'd like this file to be expanded so as to make it easier to debug. In production, I'd like this file to be minified.

It seems that the only way to set the SASS compiler to do minification is to hardcode the value into

Is there a way for me to vary the SASS compilation output style based on


You could use an additional config file to override the compressed style on development with the --config option, and ignore it on production (


  style: compressed


  style: expanded can be nested, compact, expanded or compressed.


bundle exec jekyll serve --config _config.yml,_config-dev.yml

Since the dev file is last, its options overwrite the default.


bundle exec jekyll build