Skip to content

Add an option to Disable es5 support in Build #14679

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

Closed
navneetsingh-cpu opened this issue Jun 5, 2019 · 7 comments
Closed

Add an option to Disable es5 support in Build #14679

navneetsingh-cpu opened this issue Jun 5, 2019 · 7 comments

Comments

@navneetsingh-cpu
Copy link

navneetsingh-cpu commented Jun 5, 2019

🚀 Feature request

- [ ] new
- [x] build
- [ ] serve
- [ ] test

Description

with the release of Version 8, Both es5 and es2015 files are generated on ng build. e.g.

main-es5.js , main-es2015.js. Build time also increased due to running two times.

Describe the solution you'd like

Add a build parameter that disables generation of *-es5.js files. For a person using only Chrome ( latest) *-es5.js files aren't required. This will speed up the build and reduce number of files.

Describe alternatives you've considered

I can manually everytime delete these tags from html `<script src="*-es5.js" type="module">`

Stackoverflow post

@clydin
Copy link
Member

clydin commented Jun 5, 2019

The browserslist file is used to determine which bundle types are required to be built. If only browsers that support ES2015+ are listed then only ES2015 bundles will be generated. The intention is for the application's browser requirements to be specified in the file and then the CLI will generate the appropriate set of files.
Changing the file to only include Chrome 70, for instance, will result in only one set of bundles.

@clydin clydin closed this as completed Jun 5, 2019
@ruslansin
Copy link

ruslansin commented Jun 14, 2019

The default configuration with browserslist generates two bundles. When using Service Workers, this has a detrimental effect on the traffic consumed, since with any update both files are always downloaded. I think this should be fixed so that only one bundle is used in the default configuration (es5) until it is possible to completely abandon the two bundles in the standard configuration.

@saiKumarGanji
Copy link

saiKumarGanji commented Jul 10, 2019

Someone please paste the browser configuration , that would generate only es6 bundles.
@clydin

@clydin
Copy link
Member

clydin commented Jul 10, 2019

Please see my comment above.

However, please note that the purpose of the Browserslist file is to represent the required target browsers for the application. The CLI will then use that list of browsers and generate the proper set and type of bundles as well as prefix and optimize the stylesheets for the application. This will ensure that the application will work as intended on the browsers that the application is required to support. Not doing so will cause the application to potentially not function or contain visual issues that may be hard to find or troubleshoot.

@navneetsingh-cpu
Copy link
Author

Someone please paste the browser configuration , that would generate only es6 bundles.
@clydin

Use last 2 Chrome versions

@elvisbegovic
Copy link
Contributor

@saiKumarGanji
If you really want support es2015 only, check #14639 (comment)

@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 9, 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

No branches or pull requests

5 participants