【前端开发】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')
                    }
                ]
            }),
复制代码

 

posted @   咸鱼翻身  阅读(2799)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
历史上的今天:
2021-02-26 【Python】图片有效性管理
2017-02-26 Java Tomcat 注册为Windows系统服务
2017-02-26 Java Tomcat 启动闪屏-原因之一---配置问题
2016-02-26 PHP-003
2016-02-26 Windows7安装Mongodb
点击右上角即可分享
微信分享提示