lautis / uglifier

Ruby wrapper for UglifyJS JavaScript compressor.
http://www.rubydoc.info/gems/uglifier
MIT License
613 stars 82 forks source link

Incorrect options interpretation for `compress: false` #120

Closed RKushnir closed 6 years ago

RKushnir commented 7 years ago

Hi, when initializing Uglifier with compress: false, it treats it as if you want to compress with default settings, instead of disabling the compression altogether.

I figured, it's caused by this line https://github.com/lautis/uglifier/blob/b183403ac741c8f6af16cd0bae0a61096cce1168/lib/uglifier.rb#L237 Given compress: false and no value for :squeeze, the expression @options[:compress] || @options[:squeeze] evaluates to nil, leading to usage of default settings.

An obvious workaround is to set squeeze: false.

lautis commented 6 years ago

Fixed in 76d42e85a2a2fef2a35e39354457c67e76f62d3f

lautis commented 6 years ago

Fixed in 4.0.0