【前端开发】Webpack electron打包--ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema


ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
 - options[1] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
vue.js
npm
module.exports = {
  plugins: [
    new CopyWebpackPlugin({
      patterns: [
        { from: Path.resolve('./modules/web/static/'), to: './assets' },
        { from: Path.resolve('./modules/web/static/favicon.ico'), to: './' },
      ]
    }),
    new TsChecker({ typescript: { configFile: Path.resolve('tsconfig.json') } }),
        //cesium相关资源目录需要拷贝到系统目录下面
            // new CopyWebpackPlugin([{
            //     from: path.join(cesiumSourcePath, 'Workers'),
            //     to: path.join(config.output.path, cesiumRunPath, 'Workers')
            // }]),
            // new CopyWebpackPlugin([{
            //     from: path.join(cesiumSourcePath, 'Assets'),
            //     to: path.join(config.output.path, cesiumRunPath, 'Assets')
            // }]),
            // new CopyWebpackPlugin([{
            //     from: path.join(cesiumSourcePath, 'ThirdParty'),
            //     to: path.join(config.output.path, cesiumRunPath, 'ThirdParty')
            // }]),
            // new CopyWebpackPlugin([{
            //     from: path.join(cesiumSourcePath, 'Widgets'),
            //     to: path.join(config.output.path, cesiumRunPath, 'Widgets')
            // }])
new CopyWebpackPlugin({
                patterns: [{
                        from: path.join(cesiumSourcePath, 'Workers'),
                        to: path.join(config.output.path, cesiumRunPath, 'Workers')
                    },
                    {
                        from: path.join(cesiumSourcePath, 'Assets'),
                        to: path.join(config.output.path, cesiumRunPath, 'Assets')
                    },
                    {
                        from: path.join(cesiumSourcePath, 'ThirdParty'),
                        to: path.join(config.output.path, cesiumRunPath, 'ThirdParty')
                    },
                    {
                        from: path.join(cesiumSourcePath, 'Widgets'),
                        to: path.join(config.output.path, cesiumRunPath, 'Widgets')
                    }
                ]
            }),

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM