Optimizing CSS and JS
Closed this issue · 2 comments
wei2912 commented
Compressing and minifying is already effective, but I believe that this plugin can be made more effective through these ways:
- JSlim (https://github.com/zgrossbart/jslim) which can remove unused functions in JS
- Deadweight (https://github.com/aanand/deadweight) which can remove unused CSS. Not able to check JS files.
- Google Closure Compiler to optimize JS.
- Combine similar rules.
Here's what I mean by No. 4.
a {
color: #000000;
}
p {
background-color: #000000;
color: #000000;
}
INTO
a, p {
color: #000000;
}
p {
background-color: #000000;
}
after minification to avoid problems with whitespace. It should only execute if minification suceeds. Which means the actual result would look like:
a,p{color:#000000;}p{background-color:#000000;}
stereobooster commented
I will add your ideas to my list
stereobooster commented
- Google Closure Compiler to optimize JS.
I'm using uglifier
which gives the same quality of compression and doesn't depend on Java
- Combine similar rules.
There is pending test for this in css_press
All other is on my list too. So I'm closing this for now