Suggestion: consistent config or use browserslist for build config
See original GitHub issueCurrently the default build config is inconsistent:
- TypeScript transpilation is set on
es5
(so for IE), - but polyfills are set for evergreen (so not for IE),
- and now auto-prefixer is set on IE9+ with default
browserslist
file in v6.
The default configuration should at least be consistent for those 3 aspects of compatibility.
I know that the TS target was stuck on es5
because of one special case (about tests I guess), I don’t know if it’s still a problem (@filipesilva ?).
But the CLI could do even better: now that there is an explicit default browserslist
file, maybe it could use it to adapt the configuration of TS and polyfills automatically.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Speed up with Browserslist
By default, if there is no config in the project, Browserslist will use default browsers. This query is an alias for > 0.5%,...
Read more >Browserslist is a Good Idea
Browserslist is about a single configuration for all tools that need to know what browsers you support. We just looked at two major...
Read more >email images not displaying - Page 3
Is anyone else all of a sudden not seeing graphics in CC sent emails? ... We've googled and looked at security settings and...
Read more >5 Tips to Improve Ionic Angular App Performance
Reduce app build times by adding a Browserslist file ... A Browserslist file specifies the browsers that an app supports. Developer tools can...
Read more >browserslist - npm
Browserslist will take queries from tool option, browserslist config, .browserslistrc config, browserslist section in package.json or ...
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
At this point in the release cycle, defaulting to ES2015 would need to be a change that could be considered for 7.0. And there are definite merits to making that change.
As to the polyfills/browserslist sync, there is now a PR for this: https://github.com/angular/devkit/pull/774
Thanks for reopening the issue.
About ES2015, if it’s recommended to distribute librairies in ES2015, it’s a fortiori recommended for apps too. Otherwise, if all apps always retarget to ES5, then having the library distributed in ES2015 was not necessary in the first place.
Of course, which configuration should be enabled by default (evergreen or old browsers) would be a huge debate, with a lot of pros and cons on each side.
But a major point is: I think there is an important and good reason polyfills are configured for evergreen only by default: it’s because activating all the polyfills has a huge size/performance impact. It is certainly why that choice was done in the first place. And, correct me if I’m wrong, but I don’t think you’ll change your mind about this (and it’s good for me).
Then, as users who wants IE support have to take action for polyfills, it would be better if the other aspects (ES target and auto-prefixer) were consistent and configured for evergreen by default too.
That way, only people needing IE support would have to take action, instead of currently everyone has to take action to match their needs (of course, you can build for evergreen without taking action with the current options, but then you’re not in an optimized configuration, which is one of the main goals of the CLI).