Skip to content

Provide a way of enabling differential loading only on certain builds #14602

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
mattlewis92 opened this issue May 30, 2019 · 6 comments
Closed

Comments

@mattlewis92
Copy link
Contributor

🚀 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

@alan-agius4 alan-agius4 added area: @angular-devkit/build-angular needs: discussion On the agenda for team meeting to determine next steps feature Issue that requests a new feature labels May 31, 2019
@ngbot ngbot bot modified the milestone: Backlog May 31, 2019
@alan-agius4 alan-agius4 removed the needs: discussion On the agenda for team meeting to determine next steps label May 31, 2019
@marczellm
Copy link

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!

@alan-agius4 alan-agius4 added triage #1 needs: discussion On the agenda for team meeting to determine next steps labels May 27, 2020
@dgp1130 dgp1130 added devkit/build-angular:browser and removed needs: discussion On the agenda for team meeting to determine next steps labels May 27, 2020
@katyapavlenko
Copy link

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

@SchnWalter
Copy link
Contributor

For Angular v10 a new --legacy-browsers flag was added in a723af4, if you don't provide that flag, ES5 bundles won't be present in your builds.

@mattlewis92
Copy link
Contributor Author

For Angular v10 a new --legacy-browsers flag 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.

@alan-agius4
Copy link
Collaborator

This issue is now obsolete since differential loading will be removed in the next major version. See: #21467

@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 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants