[已解决]CopyWebpackPlugin报错TypeError: compilation.fileDependencies.push is not a function

weboack cli3 遇到这问题,网上目前还没有答案 CopyWebpackPlugin报错CopyWebpackPlugin TypeError: compilation.fileDependencies.push is not a function

demo 请狠狠的点这里 https://download.lllomh.com/cliect/#/product/JB23148366892270

找到包文件 删除这行就可以了

    "copy-webpack-plugin": "^4.0.1",

[已解决]CopyWebpackPlugin报错TypeError: compilation.fileDependencies.push is not a function_第1张图片

位置 

          new CopyWebpackPlugin([
                    {
                       from: path.resolve(__dirname, './public/index.html'),
                        to: '',
                        ignore: ['.*']
                    }
                ])

 把 里面的 index.html拷贝在 dist中。默认会生成,因为本来就默认public 的东西就会自动到 dist中去,所以这里 to 就不需要写路径了

 

    new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../static/test.html'),
        to: 'dist',
        ignore: ['.*']
      },

      'node_modules/wsrpc-python/*.js' //报错的 string 的话可以删除
    ])

 

你可能感兴趣的:(我的碎屑世界,#,Vue,vue.js,html5,webpack)