stereobooster/jekyll-press

Optimizing CSS and JS

Closed this issue · 2 comments

Compressing and minifying is already effective, but I believe that this plugin can be made more effective through these ways:

  1. JSlim (https://github.com/zgrossbart/jslim) which can remove unused functions in JS
  2. Deadweight (https://github.com/aanand/deadweight) which can remove unused CSS. Not able to check JS files.
  3. Google Closure Compiler to optimize JS.
  4. 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;}

I will add your ideas to my list

  1. Google Closure Compiler to optimize JS.

I'm using uglifier which gives the same quality of compression and doesn't depend on Java

  1. 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