You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript input: create file test.js with the next code
function f1 (variable) {
return variable*2
}
function f2 () {
return false
}
module.exports = {
f1,
f2
}
The uglifyjs CLI command executed
uglify-js test.js
An example of JavaScript output produced and/or the error or warning.
SyntaxError: Unexpected token punc «,», expected punc «:»
at JS_Parse_Error.get (eval at <anonymous> (C:\Users\jmesa.SISTEL\AppData\Roaming\npm\node_modules\uglify-js\tools\node.js:27:1), <anonymous>:86:23)
at C:\Users\jmesa.SISTEL\AppData\Roaming\npm\node_modules\uglify-js\bin\uglifyjs:384:39
at time_it (C:\Users\jmesa.SISTEL\AppData\Roaming\npm\node_modules\uglify-js\bin\uglifyjs:620:15)
at C:\Users\jmesa.SISTEL\AppData\Roaming\npm\node_modules\uglify-js\bin\uglifyjs:345:9
at tryToString (fs.js:448:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:435:12)
To fix the code I have 2 workaround: use acorn (uglify-js --acorn test.js)
or I modifify the code like this:
module.exports = {
f1:f1,
f2:f2
}
The problem is that code like this is inside a lot of external modules and I want to use webpack uglify plugin.
The text was updated successfully, but these errors were encountered:
Bug
uglify-js 2.8.15
The
uglifyjs
CLI command executeduglify-js test.js
An example of JavaScript output produced and/or the error or warning.
To fix the code I have 2 workaround: use acorn (uglify-js --acorn test.js)
or I modifify the code like this:
The problem is that code like this is inside a lot of external modules and I want to use webpack uglify plugin.
The text was updated successfully, but these errors were encountered: