Error reporting from the client that always reports an error on line 1 (because the file is minified) is not very useful. I'd like to minify my code while preserving line breaks so that I get meaningful line numbers.
Are there any javascript minifiers that have an option to preserve line breaks?
Take a look at closure compiler from Google with pretty print option enabled
There are also plenty of options if you use the command line tool.
I've been looking for the same thing and although I've not found exactly what I want, I've just seen that the (now deprecated) YUI Compressor has a --line-break 0
switch that causes a line break to be inserted after each semicolon. Since I was using YUI Compressor anyway, I think this will do for my debugging purposes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With