Ember - Minify CSS File in public Folder


#1

When I build my ‘super-rentals’ Ember app with command ‘ember build -prod’ all css files in ‘app\styles’ folder are minified but css files in ‘public\assets\css’ folder are not minified. So, how could I minify all css file in ‘public\assets\css’ folder?


#2

Conventionally, the public folder is for files you want unaltered in the final output. It would be easiest just to move the files to app/styles.

If you really want to do this, you will need to use a little broccoli in your ember-cli-build.js.

let CSSminifier = require('broccoli-clean-css');
let anotherStylesTree = new CSSMinifier('public/assets/css');

return app.toTree(anotherStylesTree);