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
{{ message }}
Repository navigation
ng build -prod FAILS with UglifyJs error when targeting ES2015!! #7149
Create new app. Target tsconfig to ES2015. Build with -prod flag. Get the errors.
The log given by the failure.
ERROR in main.d3a567e3e4474c9592a2.bundle.js from UglifyJs
Unexpected token: name (AppModule) [main.d3a567e3e4474c9592a2.bundle.js:23,6]
Mention any other details that might be useful.
When I set ES2015 as target in my tsconfig, I can't use -prod flag anymore! Getting UglifyJs errors!
My limited research concludes that Uglify cannot parse ES6, link here: webpack/webpack#2972 (comment)
I need -prod flag, and I need to target ES2015. Am I missing something?
Reacted by Danilo Arcidiacono, Kalyan A and hiepxanh
What @siedentm said is correct. Currently the CLI does not support ES2015 as an option when compiling modules I believe. The CLI would have to adjust the uglify plugin dependent on the module type set in the TSConfig.
Activity
siemato commentedon Jul 26, 2017
As far as I know UglifyJS does not support es2015.
This is a statement from the UglifyJS Readme:
coryrylan commentedon Jul 26, 2017
What @siedentm said is correct. Currently the CLI does not support ES2015 as an option when compiling modules I believe. The CLI would have to adjust the uglify plugin dependent on the module type set in the TSConfig.
filipesilva commentedon Jul 31, 2017
Duplicate of #2907
hiepxanh commentedon Oct 12, 2017
hello, I upgrade to angular 5 beta 4 and still get errror Unexpected token: name (AppModule), what should i do ?
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.