electronBuilder 根本无法捆绑我的资源
electronBuilder can't bundle my resource at all
这是我的 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
从未将其大小添加到我的应用程序中。
顺便说一句,我阅读并尝试了这些:
- https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/76
- https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/539
- 等等
信息:
- electron-builder 版本=22.10.5
- 构建命令
vue-cli-service electron:build
那么我该如何解决我的问题呢?
我发现了问题,需要使用builderOptions
:
module.exports = {
pluginOptions: {
electronBuilder: {
builderOptions:{
extraResources: [
{from:'./src/resources/myengine',to:'./'}],
}
}
}
};
一个就够了:)
这是我的 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
从未将其大小添加到我的应用程序中。
顺便说一句,我阅读并尝试了这些:
- https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/76
- https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/539
- 等等
信息:
- electron-builder 版本=22.10.5
- 构建命令
vue-cli-service electron:build
那么我该如何解决我的问题呢?
我发现了问题,需要使用builderOptions
:
module.exports = {
pluginOptions: {
electronBuilder: {
builderOptions:{
extraResources: [
{from:'./src/resources/myengine',to:'./'}],
}
}
}
};
一个就够了:)