fix: Windows 平台 electron-builder 打包 asar 缺失 dist 目录#211
Merged
btc69m979y-dotcom merged 1 commit intomainfrom Mar 2, 2026
Merged
fix: Windows 平台 electron-builder 打包 asar 缺失 dist 目录#211btc69m979y-dotcom merged 1 commit intomainfrom
btc69m979y-dotcom merged 1 commit intomainfrom
Conversation
将 electron-builder.json 中 files 配置从 glob 字符串改为对象格式,
使用 from/to/filter 明确指定 dist 和 dist-electron 目录。
glob 字符串格式 ("dist/**/*") 在 Windows 上由于路径分隔符差异,
minimatch partial matching 无法正确识别目录,导致 dist/ 和
dist-electron/ 未被打包进 asar,构建失败。
同时添加 .npmignore 确保 electron-builder 不会因 .gitignore 排除
构建产物目录。
This was referenced Mar 3, 2026
mammut001
pushed a commit
to mammut001/LobsterAI
that referenced
this pull request
Mar 11, 2026
…-electron-builder-packaging fix: Windows 平台 electron-builder 打包 asar 缺失 dist 目录
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
electron-builder.json中files配置从 glob 字符串格式改为对象格式(from/to/filter),明确指定dist和dist-electron目录.npmignore文件,防止 electron-builder 因.gitignore排除构建产物目录glob 字符串格式(
"dist/**/*"、"dist-electron/**/*")在 Windows 上由于路径分隔符差异,minimatch 的 partial matching 无法正确识别目标目录,导致dist/和dist-electron/未被打包进app.asar,构建报错:对象格式为每个目录创建独立的 walker,直接从指定目录开始遍历,绕开了根目录 partial matching 的问题。该改动对 macOS 和 Linux 构建无影响。