Skip to content

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

Merged
hansl merged 1 commit into
angular:masterfrom
filipesilva:es6-target
Sep 13, 2017
Merged

feat(@angular/cli): support ES2015 target#7610
hansl merged 1 commit into
angular:masterfrom
filipesilva:es6-target

Conversation

@filipesilva

@filipesilva filipesilva commented Sep 6, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

@jimmykane

Copy link
Copy Markdown

I bow!

@jimmykane

Copy link
Copy Markdown

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

pgrm commented Sep 14, 2017

Copy link
Copy Markdown

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

@ghost

ghost commented Sep 16, 2017

Copy link
Copy Markdown

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

@misaunde

misaunde commented Sep 28, 2017

Copy link
Copy Markdown

What about ng serve --aot?

@pgrm

pgrm commented Sep 29, 2017

Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

gordlf11 commented Feb 1, 2018

Copy link
Copy Markdown

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
Copy Markdown

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