Provide a way of enabling differential loading only on certain builds
See original GitHub issueπ Feature request
Command (mark with an x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
Currently browserslist is used to determine whether to create an es5 build as well as es2015. However that is global for the whole project, what Iβd like is a way to only build an es5 version on our production environment, our staging environment already takes ~20 minutes to build, building an es5 version is only going to make this build time longer and all of our staging users are on modern browsers
Describe the solution youβd like
To allow forcing differential loading for certain builds in angular.json via the es5BrowserSupport flag. Currently it only has an effect on the polyfills and not whether an es5 build is created.
Describe alternatives youβve considered
There are no arounds AFAIK
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
Top Results From Across the Web
A Guide to Angular 8's Differential Loading | by Auth0 | Medium
Differential loading lets you serve up different bundles to different browsers and make your application even faster! Angular 8 has only been out...
Read more >A Guide to Angular 8's Differential Loading Feature - Auth0
Differential loading lets you serve up different bundles to different browsers and make your application even faster! Angular 8 has only ...
Read more >Angular 8 CLI: Disable differential loading in development serve
In Angular CLI version 8 and higher, differential loading is enabled by default for the ng build command. The ng serve, ng test,...
Read more >Deployment - Angular
Differential loading is a strategy that allows your web application to support multiple browsers, but only load the necessary code that the browser...
Read more >What's new in Angular CLI 13.0? - Ninja Squad
As a result, ng build no longer does differential loading, and only outputs ES2015+ code. IE11 no longer being a concern, all the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think thatβs a schematics option only, if I understood the commit correctly it just controls what gets put into the browserslist file when creating an application. i.e. you canβt do
ng build --legacy-browsersto selectively enable or disable differential loading when building different environments.Browserslist already has a feature called βenvironmentsβ, see here: https://github.com/browserslist/browserslist#configuring-for-different-environments
I tried to use it to create a βdevelopmentβ environment where no ES5 version is built, only to realize that neither BROWSERSLIST_ENV nor NODE_ENV influences the way the angular build system loads the browserslist file. Please help!