Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support options for compressors in Sprockets #2693
I'm unable to pass compressor options, such as changing the compilation_level for the closure-compiler gem to 'ADVANCED_OPTIMIZATIONS', which is the main reason I want to use this gem.
Granted I can write my own compressor, but ultimately I'd define something like config.assets.js_compressor_options which does take a hash. It is left to the user to pass proper options, if supported at all, to their underlining compressor of their choice.
Upon further inspection I came around with this:
Passing directly your own constructor works fine it seems.
I'll leave the thread open for eventual comment, feel free to close if passing a options constructor it's not a wanted feature.
I know it's a pretty old thread, wouldn't be better to pass arguments after the first to the compressor constructor? like:
It seems cleaner to me since you don't need to add a require and instantiate the compressor there