1. babel-plugin-polyfill-corejs3
A Babel plugin to inject imports to core-js@3 polyfills
babel-plugin-polyfill-corejs3
Package: babel-plugin-polyfill-corejs3
Created by: babel
Last modified: Wed, 20 Mar 2024 11:37:39 GMT
Version: 0.10.4
License: MIT
Downloads: 107,779,536
Repository: https://github.com/babel/babel-polyfills

Install

npm install babel-plugin-polyfill-corejs3
yarn add babel-plugin-polyfill-corejs3

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 [email protected] 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.20.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.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin