Adding an option to disable UglifyJS
Cowboy-coder opened this issue · 3 comments
Really nice lib!
The reason it'd be nice to disable uglifyJS is to prevent it from breaking code in production mode. The reason I'm asking is because I'm currently depending on CoffeeKup https://github.com/mauricemach/coffeekup for client-side rendering but as soon as UglifyJS "uglifies" my code, CoffeeKup breaks.
And I think it would be nice in other situations aswell, because currently you are pretty much screwed if you are using a 3rd party lib that doesn't support being "uglified".
Also... :)
The only way to have the css and the javascript files being minified right now is by running NODE_ENV=production
, but it would be nice if this wasn't hard-coded so that you could serve minified css and js files in staging
environments and such as well.
This is something already in my todo-list. One global disable option is easily doable, but for disabling some specific asset is problematic since UglifyJS expects that it gets the whole js-file to itself. Things seem to break if we minify every asset separately and concatenate them. Concatenating first and then minifying all at once seems to be more robust.
I need to do some more tests. Good ideas are very welcome.
new UglifyJS 2.x should make this a reality, since you can continue from previous 'toplevels', at will, definitely should arrive before the big change in 1.0.0
you can define processors options per asset using addOb, addFile, addRaw, etc!