babel-plugin-polyfill-corejs3

A Babel plugin to inject imports to core-js@3 polyfills

MIT 58 个版本
安装
npm install babel-plugin-polyfill-corejs3
yarn add babel-plugin-polyfill-corejs3
pnpm add babel-plugin-polyfill-corejs3
bun add babel-plugin-polyfill-corejs3
README

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.48" }]]
}

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.48.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.

版本列表
1.0.0-rc.2 2026-04-10
1.0.0-rc.1 2026-04-10
1.0.0 2026-06-17
0.14.2 2026-03-16
0.14.1 2026-03-06
0.14.0 2026-01-23
0.13.0 2025-06-27
0.12.0 2025-03-19
0.11.1 2025-01-24
0.11.0 2024-11-11
0.10.6 2024-08-04
0.10.4 2024-03-20
0.10.3 2024-03-20
0.10.2 2024-03-20
0.10.1 2024-03-12
0.10.0 2024-03-08
0.9.0 2024-01-18
0.8.7 2023-12-11
0.8.6 2023-10-23
0.8.5 2023-10-11
0.8.4 2023-09-23
0.8.3 2023-07-21
0.8.2 2023-07-05
0.8.1 2023-05-10
0.8.0 2023-05-10
0.7.1 2023-03-01
0.6.0 2022-09-13
0.5.3 2022-07-24
0.5.2 2022-02-01
0.5.1 2022-01-15
0.5.0 2021-12-31
0.4.0 2021-11-13
0.3.0 2021-10-29
0.2.5 2021-09-22
0.2.4 2021-07-28
0.2.3 2021-06-16
0.2.2 2021-05-26
0.2.1 2021-05-21
0.2.0 2021-03-31
0.1.7 2021-03-02
0.1.6 2021-02-25
0.1.4 2021-02-23
0.1.3 2021-02-23
0.1.2 2021-02-22
0.1.1 2021-02-22
0.1.0 2021-01-09
0.0.11 2021-01-07
0.0.10 2020-12-22
0.0.9 2020-12-22
0.0.8 2020-12-09
0.0.7 2020-11-09
0.0.6 2020-10-03
0.0.5 2020-08-31
0.0.4 2020-08-18
0.0.3 2020-07-10
0.0.2 2020-05-26
0.0.1 2020-05-26
0.0.0 2020-04-08