电子构建器没有生成DIST文件

发布于 2025-02-12 02:06:11 字数 419 浏览 1 评论 0原文

我正在尝试使用电子构建器构建一个安装程序,但是每次我生成安装程序并安装我的应用程序时,我都会发现一个错误,即.asar文件中不存在“ DIST/INDEX”。我检查了一下,没有任何区域包装在.asar内部。

我遇到的错误:

不允许加载本地资源:file:/// c:/users/user1/appdata/local/programs/myapp/resources/app.asar/dist/index.html

我正在使用此脚本构建: “ publish”:“设置gh_token =< my_token>&&&&& equal-builder -win -p始终“始终”

电子构建器是否有任何标志告诉他在哪里放置输出文件?

I'm trying to build an installer with electron-builder but every time I generate the installer and install my application, I get an error that "dist/index" doesn't exist in .asar file. I checked and no dist file is packed inside .asar.

The error I'm getting:

Not allowed to load local resource: file:///C:/Users/user1/AppData/Local/Programs/myApp/resources/app.asar/dist/index.html

I'm building with this script:
"publish": "set GH_TOKEN=<my_token> && electron-builder --win -p always"

Does electron-builder have any flags to tell him where to put the output files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花海 2025-02-19 02:06:11

经过一些反复试验后,我发现了问题所在...
因此,基本上是我的软件包。JSON配置错误。为了在构建中包含dist,必须这样指定:

...
"build": {
    "appId": "si.app.testing",
    ...
    "directories": {
        "output": "release",
        "buildResources": "dist"
    },
    "files": [
        "**/*",
        "dist/**/*",
        ...
        "!.github",
        "!.vs",
        "!node_modules/*"
    ]
},
...

Okey after some trial and error, I found what was wrong...
So basically my package.json was configured wrong. In order to include dist in build it must be specified like this:

...
"build": {
    "appId": "si.app.testing",
    ...
    "directories": {
        "output": "release",
        "buildResources": "dist"
    },
    "files": [
        "**/*",
        "dist/**/*",
        ...
        "!.github",
        "!.vs",
        "!node_modules/*"
    ]
},
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文