Skip to content
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

feat(@angular/cli): support ES2015 target #7610

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Sep 6, 2017

The CLI will now prefer ES2015 modules and use uglify-es for an app when the TypeScript configuration uses "target": "es2015" or greater.

You can change "target": "es2015" in the root tsconfig.json and it will be picked up by the other tsconfigs.

Fix #2907
Fix #7532

@jimmykane
Copy link

Thanks for this? Is there a plan for merging this soon ?

@jimmykane
Copy link

I bow!

@jimmykane
Copy link

I think a lot of issues on Angular repo should be closed by this, and even more on S.O.

@filipesilva filipesilva deleted the es6-target branch September 13, 2017 20:07
@pgrm
Copy link

pgrm commented Sep 14, 2017

@filipesilva how can I make this work so that AOT builds use es2015, but ng serve during development uses es5?

@ghost
Copy link

ghost commented Sep 16, 2017

@pgrm Good question, I am trying to figure out that aswell... (as ng serve does not seem to work with es2015)

@misaunde
Copy link

misaunde commented Sep 28, 2017

What about ng serve --aot?

@pgrm
Copy link

pgrm commented Sep 29, 2017

@misaunde I do remember in the old and forever long ng serve is slow issue, that people got told, to not use ng serve --aot because it's slow. Also, I think you can't run unit tests in AOT. So I'm wondering what angular 5 will bring in this regard, because I'm reading everywhere, that AOT will be there by default. But an issue regarding AOT in unit tests is still opened. Maybe @filipesilva could shed some light on what is the best approach now, and how will that probably change with angular 5?

@filipesilva
Copy link
Contributor Author

@pgrm AOT is now much faster with 1.5 and Angular 5 (at the same time), but we won't switch AOT to be the default in 1.5.

@filipesilva
Copy link
Contributor Author

@pgrm #7797 is still blocked on Angular itself for now... I'll respond there with a workaround for now.

@misaunde ng serve --aot will also use es2015 if you have it set in your tsconfig.

@stevebread
Copy link

Does this config apply to global scripts referenced in apps[0].scripts in angular-cli.json? I am using CLI 1.5.4 with "target": "es2015" and still seeing the Unexpected token error with a prod build when the scripts use es2015 syntax

@gordlf11
Copy link

gordlf11 commented Feb 1, 2018

I've installed uglify-es and set my to "target": "es2015" but I am still experiencing an Unexpected token error with a prod build.

image

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probable issue with uglify, causing signalr-client to fail to build in production ES2015 Build Target
8 participants