Using Uglify 3.0 results in errors
See original GitHub issueI’m submitting a bug report
- Library Version: 0.29.0
Please tell us about your environment:
-
Operating System: OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]
-
Node Version: 6.2.0
- NPM Version: 3.8.9
-
Browser: all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView
-
Language: all | TypeScript X.X | ESNext
Current behavior: When uglify-js@3.0.0 is used, production builds fail:
Digging a bit further yields the follow error:
{ error:
{ DefaultsError: `fromString` is not a supported option
at DefaultsError.get (eval at <anonymous> (/Users/romainlanz/workspace/fivb/app.fivb.org/node_modules/uglify-js/tools/node.js:21:1), <anonymous>:86:23)
at formatError (util.js:640:15)
at formatValue (util.js:544:18)
at formatProperty (util.js:798:15)
at util.js:646:12
at Array.map (native)
at formatObject (util.js:645:15)
at formatValue (util.js:585:16)
at inspect (util.js:200:10)
at exports.format (util.js:66:24)
message: '`fromString` is not a supported option',
defs:
{ compress: {},
ie8: false,
keep_fnames: false,
mangle: {},
output: {},
parse: {},
sourceMap: false,
timings: false,
toplevel: false,
warnings: false,
wrap: false } } }
This is because Uglify-js@3 has a new API that is not backwards compatible with uglify-js@2:
Expected/desired behavior:
-
What is the expected behavior? aurelia-cli to work with uglify-js@3
-
What is the motivation / use case for changing the behavior?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Catching and handling Uglify errors when using Gulp
According to the Uglify documentation, gulp-uglify emits an 'error' event if it is unable to minify a specific file. Wherever possible, the ...
Read more >uglify-js - npm
Start using uglify-js in your project by running `npm i uglify-js`. ... var result = UglifyJS.minify(code); console.log(result.error); ...
Read more >gulp-uglify-chylvina - npm Package Health Analysis - Snyk
gulp-uglify emits an 'error' event if it is unable to minify a specific file. The GulpUglifyError constructor is exported by this plugin for ......
Read more >Gulp-uglify NPM - npm.io
gulp-uglify emits an 'error' event if it is unable to minify a specific file. The GulpUglifyError constructor is exported by this plugin for...
Read more >demo/node_modules/uglifyjs-webpack-plugin ... - GitLab
uglify -es is API/CLI compatible with uglify-js@3 . uglify-es is not backwards ... var result = UglifyJS.minify(code); console.log(result.error); // runtime ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We just tried upgrading to uglify-js@3.0.15 - au build --env prod still fails, but there are no errors, instead the app-bundle.js / vendor-bundle.js files just contain the text “undefined”.
Will wait for an update to aurelia-cli here.
@huochunpeng take a look at https://github.com/aurelia/framework/pull/790