When our production app throws an error it's always on the same line and makes it extremely hard to debug. We've enabled source maps, but this is little help for various reasons. It would be so helpful if we could maintain line breaks when minifying the code which would give us a better clue as to where the problem is. Then I could at least hunt through the compressed code. Any way to do this?

有帮助吗?

解决方案

Well, you can always pass the -b option to UglifyJS (read here). This preserves the line breaks and indentation of the file.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top