Closed jprichardson closed 10 years ago
Do you have an error message?
Here's part of it:
Error: Parsing file /Users/jpProjects/tmp/build/index.js: Line 15: Unexpected token ,
Here's the uglified line:
onDeviceReady: function() {
console.log(""), console.log("device ready..."), checkPlugins(), navigator.splashscreen.hide();
}
Line 15 is the console.log
line. Hope this helps some.
Yep, that'll break it. You'll end up with:
onDeviceReady: function() {
, , checkPlugins(), navigator.splashscreen.hide();
}
Yup. Is it possible to somehow fix this so that it works with Uglify? Maybe some Uglify setting?
I wanted to avoid it, but it might be necessary. The fix is to replace with a constant - "0" or something. Uglify dead code eliminator will then strip that out.
Alternatively use the drop_console
option https://github.com/mishoo/UglifyJS2
Excellent, wasn't aware of drop_console
, thanks for the help :)
If I remove this transform, uglify + Browserify works fine. But including this transform will cause an error on the uglified code.