• 【前端开发】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')
                        }
                    ]
                }),
  • 相关阅读:
    spring boot 1.4 整合 mybatis druid
    大话设计模式读书笔记--6个原则
    大话设计模式读书笔记--23.访问者模式
    大话设计模式读书笔记--22.解释器模式
    大话设计模式读书笔记--21.享元模式
    大话设计模式读书笔记--20.中介者模式
    大话设计模式读书笔记--19.责任链模式
    大话设计模式读书笔记--18.命令模式
    大话设计模式读书笔记--17.桥接模式
    大话设计模式读书笔记--17.单例模式
  • 原文地址:https://www.cnblogs.com/defineconst/p/15940234.html
Copyright © 2020-2023  润新知