Is there an easy way to determine which JS features are available for a given version of @babel/preset-env? #11792
Unanswered
mattdiamond
asked this question in
Q&A
Replies: 1 comment
-
Per https://babeljs.io/docs/en/babel-preset-env#debug, {
"presets": [
[
"@babel/preset-env",
{
"debug": true,
"target": { "chrome": 80 }
}
]
]
} will output
You can also query require("@babel/compat-data/plugins") which is a plain JSON like {
"proposal-numeric-separator": { "chrome": 75 },
"proposal-class-properties": { "chrome": 74 },
// other plugin names
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Buried in the docs for @babel/preset-env is a link to a list of default plugins:
https://github.com/babel/babel/blob/v7.10.4/packages/babel-compat-data/scripts/data/plugin-features.js
Is this the only place this information is stored? It seems pretty important, and yet the documentation only mentions it in passing. Is there another way for a developer to find out which plugins are included with a specific version of preset-env, or is the above file the only resource for this information?
Beta Was this translation helpful? Give feedback.
All reactions