davidB / yuicompressor-maven-plugin

maven's plugin to compress (Minify / Ofuscate / Aggregate) Javascript files and CSS files using YUI Compressor
http://davidb.github.io/yuicompressor-maven-plugin/
GNU Lesser General Public License v2.1
122 stars 48 forks source link

Add configuration option to omit compressed files that are larger than the original #68

Closed dlh3 closed 10 years ago

dlh3 commented 10 years ago

When a compression results in a larger file size than the source, I would like to skip compression on that file and include the raw source in the generated output.

A configuration property is more flexible and preferable to manually excluding files with this result.

Example (actually 100.5%):

[INFO] jquery.scrollable.min.js (101050b) -> jquery.scrollable.min.js (101583b)[100%]

With plugin version 1.1, the compressed file was actually 102% of the original size.

dlh3 commented 10 years ago

Pull request adds "useSmallestFile" configuration (default true) to discard compressed output and instead copy input to output. Applies only to the minify, not gzip compression.

f984ef7 cleans up a couple small formatting inconsistencies.

davidB commented 10 years ago

Thanks