0

这是我的vue.config.js

module.exports = {
    pluginOptions: {
        electronBuilder: {
            preload: './src/preload.js',
                extraResources: ['resources/myengine'],
                "files": [
                "**/*"
                ],
                "extraFiles": [
                {
                    "from": "resources/myengine",
                    "to": "'./resources/app.asar.unpacked/myengine",
                },
                {
                    "from": "resources",
                    "to": "resources",
                    "filter": ["**/*"]
                }
        ]
    }
}

我尝试了所有解决方案来附加我的资源,但任何结果:( 注意:myengine从未5mb将其大小添加到我的应用程序中。

顺便说一句,我阅读并尝试了这些:

信息:

  • 电子生成器版本=22.10.5
  • 构建命令vue-cli-service electron:build

那么我该如何解决我的问题呢?

4

1 回答 1

0

我发现了问题,需要使用builderOptions

module.exports = {
    pluginOptions: {
        electronBuilder: {
            builderOptions:{
                extraResources: [
                {from:'./src/resources/myengine',to:'./'}],
            }

        }
    }
};

其中一个就足够了:)

于 2021-08-04T08:58:06.560 回答