-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ng build -prod FAILS with UglifyJs error when targeting ES2015!! #7149
Comments
As far as I know UglifyJS does not support es2015. This is a statement from the UglifyJS Readme:
|
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. |
Duplicate of #2907 |
hello, I upgrade to angular 5 beta 4 and still get errror Unexpected token: name (AppModule), what should i do ? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Project 1: @angular/cli: 1.1.3
Project 2: @angular/cli: 1.3.0-rc.1
node: 7.10.0
os: win32 x64
In tsconfig.json: "target": "es2015"
Repro steps.
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?
The text was updated successfully, but these errors were encountered: