使用 extraResources 和 extraFiles 时遇到电子构建器问题

问题描述 投票:0回答:1

环境: 节点——版本:v18.19.1

package.json: “依赖项”:{ “@电子/远程”:“^2.1.2”, "@voerkai18n/runtime": "^2.1.5", "@voerkai18n/vue": "^2.1.5", "@vue/cli-shared-utils": "^5.0.8", “绑定”:“^1.5.0”, "body-parser": "^1.20.2", "cnpm": "^9.4.0", "core-js": "^3.8.3", “调试”:“^4.3.4”, "depd": "^2.0.0", "ee-first": "^1.1.1", “电子”:“^30.0.1”, "电子生成器": "^24.9.1", "电子生成器-松鼠-windows": "^24.13.3", "电子开发工具安装程序": "^3.2.0", "电子重建": "^3.2.9", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "express": "^4.18.2", "文件 uri-to-path": "^2.0.0", "finalhandler": "^1.2.0", "fs": "^0.0.1-安全", "html2canvas": "^1.4.1", "ip": "^2.0.1", "端口可用": "^0.1.5", "lru-cache": "^8.0.0", "lzma-native": "^8.0.6", “合并描述符”:“^2.0.0”, "ms": "^2.1.3", "节点机器 ID": "^1.1.12", "node-polyfill-webpack-plugin": "^3.0.0", "完成后": "^2.4.1", "ora": "^8.0.1", "parseurl": "^1.3.3", "路径": "^0.12.7", "path-browserify": "^1.0.1", "pg-hstore": "^2.3.4", "primevue": "^3.49.1", "qrcodejs2": "^0.0.2", "重建": "^0.1.2", "semver": "^7.6.0", "续集": "^6.37.1", “sqlite”:“^5.1.1”, “sqlite3”:“5.1.6”, "状态": "^2.0.1", "typeorm": "^0.3.20", "unzip-crx-3": "^0.2.0", "uuidjs": "^5.0.1", "vue": "^3.4.26", "vue-router": "^4.0.3", "ws": "^8.16.0", "wujie-vue3": "^1.0.22" }, “开发依赖项”:{ "@babel/core": "^7.24.1", "@babel/preset-env": "^7.24.1", "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-router": "~5.0.0", "@vue/cli-service": "~5.0.0", "babel-loader": "^9.1.3", “电子”:“^30.0.1”, "电子开发工具安装程序": "^3.1.0", "sass": "^1.32.7", "sass-loader": "^12.0.0", "vue-cli-plugin-electron-builder": "~2.1.1", “webpack-cli”:“^5.1.4” }

问题: 我试图使用电子构建器来构建我的电子应用程序,但是遇到了静态资源捆绑的问题。

vue.config.js中的代码: 在此输入图片描述

项目结构: 在此输入图片描述

然后我使用 npm run electro:build 来运行构建过程,我得到了这个: 在此输入图片描述

似乎特定的“./lib”目录没有按预期进入资源目录。我也尝试使用

FileSet
对象,但它们也不起作用。

此外,

extraFiles
似乎也不起作用。

我怀疑有问题,但作为电子初学者,我不知道有任何其他方法可以解决这个问题。

electron electron-builder electron-vue
1个回答
0
投票

问题昨天已解决。 这是由于配置格式不正确造成的。

vue.config.js
中的“electronBuilder”字典下应该有一个“builderOptions”,我不小心漏掉了。

© www.soinside.com 2019 - 2024. All rights reserved.