@ysfe/polyfill-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ysfe/polyfill-webpack-plugin

解决 vue-cli5 忽略 node_modules 编译导致的如:globalThis 未解析问题(vivo 低版本)

前置依赖

  1. node >= 8.0.0
  2. webpack 5.x

使用方式

以下结合 vue 应用场景, 整理使用文档

  1. 安装: 执行 yarn add @ysfe/polyfill-webpack-plugin --dev 安装插件

  2. 使用:

    1. vue.config.js 中, 引用插件.
       const PolyfillWebpackPlugin = require('@ysfe/polyfill-webpack-plugin').default
    
       // 通过 configureWebpack 配置
       module.exports = {
           configureWebpack: {
               plugins: [
                  new PolyfillWebpackPlugin(),
                  // other plugins ...
               ]
           }
       }
    
       // or 通过 chainWebpack 配置
    
       module.exports = {
          chainWebpack: (config) => {
             // add plugin
             config
                .plugin('PolyfillWebpackPlugin')
                .use(PolyfillWebpackPlugin)
          }
       }
    

Package Sidebar

Install

npm i @ysfe/polyfill-webpack-plugin

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.38 kB

Total Files

23

Last publish

Collaborators

  • wellfee
  • huanyansss