Electron Builder不包括嵌套的node_module



我使用electronic builder 22.6.0创建mas构建,但.app文件不包括嵌套的node_modules(myApp的node_modeles(。我试过在package.json中使用extraFiles,它在参考资料中创建了一个文件夹,并复制了其中的所有node_module,但仍然得到404。

我的包.json:

"extraResources": [
{
"from": "path/node_modules",
"to": "path/node_modules",
"filter": [
"**/*"
]
}
],

文件夹结构:

---root
--package.json
--node_modules
--myApp
--package.json
--node_modules

默认情况下,如何包含node_modules?我的电子版是8.2.0

Electron构建器将通过删除开发节点依赖项和未使用的模块来打包node_modules。我们不需要手动执行此操作。

如果您仍然想将其包含在软件包中,请将其添加到电子构建器配置中:"files": ["node_modules/**/*"]

最新更新