1. @dtinsight/auto-polyfills-webpack-plugin
a webpack plugin for auto generate polyfills
@dtinsight/auto-polyfills-webpack-plugin
Package: @dtinsight/auto-polyfills-webpack-plugin
Last modified: Thu, 25 Apr 2024 02:43:48 GMT
Version: 2.0.2
License: MIT
Downloads: 27

Install

npm install @dtinsight/auto-polyfills-webpack-plugin
yarn add @dtinsight/auto-polyfills-webpack-plugin

A webpack plugin for auto import polyfills using core-js custom build, you can combine it with esbuild-loader because esbuild-loader don't do auto polyfills

Getting Started

  1. Install as devDependencies:
 pnpm install @dtinsight/auto-polyfills-webpack-plugin -D
  1. then add it into webpack plugins config:
 config.plugins.push(
      new AutoPolyfillsWebpackPlugin();
    );

and a minified file will be generated in project root (or custom with option cwd), then you should commit it for reused.

Options

 type IOpts = {
    cwd?: string; // cwd, default value is `process.cwd()`
    browserslistPath?: string; // default value is .browserslistrc in root directory
    hashType?: string; // crypto type, default value is md5
    customPrefix?: string; //custom polyfill prefix, default value is 'dt'
    excludeCoreJsModules?: string[]; //exclude core-js modules.
};

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