babel-plugin-polyfill-corejs3 (0.13.0)
Installation
registry=npm install babel-plugin-polyfill-corejs3@0.13.0"babel-plugin-polyfill-corejs3": "0.13.0"About this package
babel-plugin-polyfill-corejs3
Install
Using npm:
npm install --save-dev babel-plugin-polyfill-corejs3
or using yarn:
yarn add babel-plugin-polyfill-corejs3 --dev
Usage
Add this plugin to your Babel configuration:
{
"plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.20" }]]
}
This package supports the usage-pure, usage-global, and entry-global methods.
When entry-global is used, it replaces imports to core-js.
Options
See here for a list of options supported by every polyfill provider.
version
string, defaults to "3.0".
This option only has an effect when used alongside "method": "usage-global" or "method": "usage-pure". It is recommended to specify the minor version you are using as core-js@3.0 may not include polyfills for the latest features. If you are bundling an app, you can provide the version directly from your node modules:
{
plugins: [
["polyfill-corejs3", {
"method": "usage-pure",
// use `core-js/package.json` if you are using `usage-global`
"version": require("core-js-pure/package.json").version
}]
]
}
If you are a library author, specify a reasonably modern core-js version in your
package.json and provide the plugin the minimal supported version.
{
"dependencies": {
"core-js": "^3.43.0"
}
}
{
plugins: [
["polyfill-corejs3", {
"method": "usage-global",
// improvise if you have more complicated version spec, e.g. > 3.1.4
"version": require("./package.json").dependencies["core-js"]
}]
]
}
proposals
boolean, defaults to false.
This option only has an effect when used alongside "method": "usage-global" or "method": "usage-pure". When proposals are true, any ES proposal supported by core-js will be polyfilled as well.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @babel/helper-define-polyfill-provider | ^0.6.5 |
| core-js-compat | ^3.43.0 |
Development Dependencies
| ID | Version |
|---|---|
| @babel/core | ^7.27.7 |
| @babel/helper-plugin-test-runner | ^7.27.1 |
| @babel/plugin-proposal-decorators | ^7.27.1 |
| @babel/plugin-transform-class-properties | ^7.27.1 |
| @babel/plugin-transform-classes | ^7.27.7 |
| @babel/plugin-transform-for-of | ^7.27.1 |
| @babel/plugin-transform-modules-commonjs | ^7.27.1 |
| @babel/plugin-transform-runtime | ^7.27.4 |
| @babel/plugin-transform-spread | ^7.27.1 |
| core-js | ^3.43.0 |
| core-js-pure | ^3.43.0 |
Peer Dependencies
| ID | Version |
|---|---|
| @babel/core | ^7.4.0 || ^8.0.0-0 <8.0.0 |