browserslist and babel-preset-env
See original GitHub issueCurrently, we default a browser list config for babel-preset-env
. I’m not sure if it’s possible yet (https://github.com/babel/babel-preset-env/pull/161), but it would be great if we allowed this to be configured via the browserslist
config key in package.json
(https://github.com/ai/browserslist).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ......
Read more >Babel with babel-preset-env seems to ignore browserslist config
"By default @babel/preset-env will use browserslist config sources unless either the targets or ignoreBrowserslistConfig options are set.".
Read more >How to create a custom .browserlistrc for babel-preset-env
Let's have a look. Start the tool like this in the root directory of your project (no further installation necessary):. npx browserslist-ga.
Read more >browserslist/browserslist: Share target browsers ... - GitHub
The config to share target browsers and Node.js versions between different front-end tools. It is used in: Autoprefixer · Babel · postcss-preset-env ·...
Read more >How babel preset-env, core-js, and browserslistrc work together
In this post we're going to see how babel preset-env, core-js, and browserslistrc work nicely together to enable newer JavaScript features ...
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
As of Encore 0.21.0, the browserslist config is respected by Babel 😃
how about configuring babel like this?:
This will get the browserlist from the environment which is what we want. I’m not sure how i can validate if that actually works as I expect.
EDIT: I figured a way out to test it. So you can set
babelConfig.presets[0][1].debug = true
which will output which polyfills and (if included) plugins are used but also “using targets”. As far as I can tell, they match my browser list which basically is “defaults, IE >= 9, not OperaMini all”. Mobile browsers are for some reason absent but that seems to be normal for babel.So yes: I think my way works. But it seems too easy.