Skip to content

Bundling dependencies into app.asar copies all files from local symlinks #9090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Nokel81 opened this issue May 6, 2025 · 5 comments
Open

Comments

@Nokel81
Copy link
Contributor

Nokel81 commented May 6, 2025

Current behaviour:
I am working in a npm monorepo environment where local packages are symlinked into node_modules. Which mean that when I come to run electron-build --config ./my-config.js all the files within those local packages are included in the bundles

Expected behaviour:
Like other dependencies from npm, the only files that should be included are those that match the files field within each package.json. This happens implicitly for external dependencies because they are pulled down from npm.

Current workaround:
I can specify my own files array of glob includes and excludes within my-config.js but that is heavy handed and only works because our source code is in ts and our build artifacts are in js.

Things I tried:

  • I tried looking at beforePack and afterPack but they don't provide the information or mechanism for blocking the inclusion of a file.
  • I tried onNodeModuleFile but that is for forcing the inclusion of a file not forcing the exclusion
@mmaietta
Copy link
Collaborator

What version of electron-builder is this? Can you try on the latest release? 26.0.15

@Nokel81
Copy link
Contributor Author

Nokel81 commented May 11, 2025

We are using 26.0.12 which is latest on npm

@mmaietta
Copy link
Collaborator

Well then try the most recent release 26.0.15

@Nokel81
Copy link
Contributor Author

Nokel81 commented May 12, 2025

Tried, it had no effect

@bennyschmidt
Copy link

bennyschmidt commented May 26, 2025

Solution here: #9124 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants