What are some good css and js minimizers for produ

2019-01-10 09:39发布

I'm looking for some applications or websites that minimize css and js files. Ideally, they could batch them all or if not, one at a time.

12条回答
Lonely孤独者°
2楼-- · 2019-01-10 10:09

YUI Compressor is pretty cool. You can run it as part of a build process from the command line

查看更多
放我归山
3楼-- · 2019-01-10 10:11

There's also a .NET port of YUI Compressor which allows you to:-

  • intergrate the minification/file combining into Visual Studio post-build events
  • intergrate into a TFS Build (including CI)
  • if you wish to just use the dll's in your own code (eg. on the fly minification).
查看更多
淡お忘
4楼-- · 2019-01-10 10:12

YUI Compressor does both JavaScript and CSS. I'm not sure if you can send it a batch of files.

You can batch process at YUI Compressor Online (yui.2clics.net), though that version only accepts JavaScript. Another Online YUI Compressor (refresh-sf.com) accepts CSS, too, but doesn't batch.

In terms of comparing the various minifiers, see jQuery : Frequently Asked Questions (FAQ) : How do I compress my code? Also, check out Microsoft Ajax Minifier.

jQuery has switched from the YUI Compressor to Google's Closure Compiler for the minified version that they distribute.

查看更多
▲ chillily
5楼-- · 2019-01-10 10:13
ら.Afraid
6楼-- · 2019-01-10 10:20

Take a look at The JavaScript CompressorRater. It does live comparisons of various minifiers (with and without gzip compression) for any JavaScript you supply it.

It also (mostly) works with CSS, though not all minifiers support it and not even all of those that do (e.g. YUI) show up correctly in the comparison table.

查看更多
The star\"
7楼-- · 2019-01-10 10:21

I use Packer by Dean Edwards for javascript.

查看更多
登录 后发表回答