In most cases of core-js usage with preset-env, I see something like corejs: 3 in the config. With installed [email protected].
The first core-js@3 release was in March 2019 and since then the number of core-js features has almost doubled.
corejs: 3 in the preset-env config is interpreted [email protected] which limits the subset of used core-js features only to features that were in [email protected] and, in most cases, is not that the user expect.
I propose to limit potentially incorrect corejs option values.
- Disallow SemVer strings without a minor component, instead of
corejs: "3" it should be at least corejs: "3.0"
- Disallow numbers: even if someone writes
corejs: 3.30 it will be interpreted as corejs: 3.3
From @JLHwung:
What about we also offer two magic options in Babel 8?
corejs: "node_modules": use whatever version in ./node_modules/core-js/package.json
This is for the people who bundle core-js with their website
corejs: "package.json": use the minimum version specified in packageJson.dependencies["core-js"]
This is for library authors that specified core-js as a dependency
For more sophisticated usage, please specify your own core-js version.
In most cases of
core-jsusage withpreset-env, I see something likecorejs: 3in the config. With installed[email protected].The first
core-js@3release was in March 2019 and since then the number ofcore-jsfeatures has almost doubled.corejs: 3in thepreset-envconfig is interpreted[email protected]which limits the subset of usedcore-jsfeatures only to features that were in[email protected]and, in most cases, is not that the user expect.I propose to limit potentially incorrect
corejsoption values.corejs: "3"it should be at leastcorejs: "3.0"corejs: 3.30it will be interpreted ascorejs: 3.3From @JLHwung:
What about we also offer two magic options in Babel 8?
corejs: "node_modules": use whatever version in./node_modules/core-js/package.jsonThis is for the people who bundle
core-jswith their websitecorejs: "package.json": use the minimum version specified inpackageJson.dependencies["core-js"]This is for library authors that specified
core-jsas a dependencyFor more sophisticated usage, please specify your own
core-jsversion.