I am working on an app that uses a NodeJS backend (including serving Yii itself) that also runs WebPack in a watcher mode all the time. WebPack creates my assets and basically is an assets build tool. The hash for the files to be used is published to Redis, in turn, end up in Yii. So this system works flawless at this time and I always serve the most up-to-date files.
Now, through WebPack, I managed to press down my JS from 544 kb to 178 kb. But once I get to strip parts of jQuery, this is ment to become 100 kb /at most/. But what about my CSS?
Well, damn. The only "good" method is UnCSS(1). But UnCSS requires static files… now, we all know just how static Yii is, right? XD So my question is: Does anyone know of a good way to shrink the CSS by removing unused classes, when using a Yii app, that uses Bootstrap, Font-Awesome and few customs under the hood?
The way my CSS comes along:
Bootstrap via SCSS: http://git.ingwie.me/ingwie/bird3/blob/master/web-lib/bootstrapper.scss
Rest is mainly in this file: http://git.ingwie.me/ingwie/bird3/blob/master/web-lib/main.oj . Each
require call. that points to a CSS file, puts the contents into an external CSS file - which is later ran through
clean-css for minification.
So yeah… halp? ^^