Open thernstig opened 3 years ago
Hey @thernstig! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."
https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries
We have a caveat section about Opera Mini and it applies to other browsers which do not have support data.
Hey @thernstig! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.
@JLHwung thanks, I had not seen that one. As you mention, there are a lot of other browsers shown when doing npx browserlist
with defaults
configured.
But what does this mean then? That section does not make it clear for me. Will it as I suspect transpile all my code to use all plugins listed in https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json ?
Or what does "ignore" in that text actually mean?
"ignore" means that we specifying it has the same effect as not specifying it, we can try making the wording clearer on the website.
We could also explicitly write the list of "not ignored" browsers, which is basically the intersection of what browserslist
supports and compat-table
lists.
Thanks @nicolo-ribaudo - but it makes sense. I do think it would be a good thing to add more documentation about this, as there are quite many browsers that npx browserlist
outputs that do not exist in the plugins.json
.
Feature Request
Is your feature request related to a problem? https://babeljs.io/docs/en/babel-preset-env#how-does-it-work states that it follows https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json to know what plugins to pass to transpile code. https://babeljs.io/docs/en/babel-preset-env#browserslist-integration also recommends to use browerlist to specify targets.
But browserlist best practices https://github.com/browserslist/browserslist#best-practices states:
It is thus confusing reading https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json and not seeing those browser there. Because if I run
npx browserslist
withdefaults
specified in.browserlistrc
, I see many browsers (such as Opera Mini) not included in theplugins.json
file. This means I assume it uses all plugins to transform my code.Describe the solution you'd like I would like the docs to be clear here how it works for all common browsers not listed in
plugins.json
. The current text makes it sound like all my code will use all plugins.