x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
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
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.
There are no arounds AFAIK
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!
Experiencing same problem, spending additional 30 seconds and 15 mb on building es5 bundles that would never be used on dev envs, waiting for this feature to be added very much
For Angular v10 a new --legacy-browsers flag was added in https://github.com/angular/angular-cli/commit/a723af4271a3e9cf35d5c386b050999ad87ed3b9, if you don't provide that flag, ES5 bundles won't be present in your builds.
For Angular v10 a new
--legacy-browsersflag was added in a723af4, if you don't provide that flag, ES5 bundles won't be present in your builds.
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-browsers to selectively enable or disable differential loading when building different environments.
Most helpful comment
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.