Allow nx-electron:build webpack to resolve node_modules #318
ratatoeskr666
started this conversation in
Feature Requests
Replies: 2 comments 2 replies
-
@ratatoeskr666 : I see you resolved this one. Why did you close it? Did you found a solution for this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I closed the discussion because there are already options to bundle external deps. "generatePackageJson": true,
"externalDependencies": "none",
"buildLibsFromSource": true,
"extractLicenses": true, Additionally I also set in "files": [
"!**/node_modules${/*}",
"!**/node_modules/*",
"!/node_modules${/*}"
] There still is the issue that no package.json is created, but the bundling worked for me. No more node_modules in the ASAR! Anyhow, maybe we could add this to the documentation/readme? @bennymeg what's your opinion about this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When building via nx-electron (webpack), dependencies from
node_modules
are not included.Instead, electron-builder copies the whole node_modules folder to the ASAR/resources. Unfortunately it copies ALL dependencies! (also dev and deps from frontend projects).
Wouldn't it be better to resolve and bundle dependencies already in the electron-build process? So that the build artifact already contains all necessary sources
In the config file you exclude node_modules. Why is that so?
nx-electron/packages/nx-electron/src/utils/config.ts
Line 39 in 4cd3f2a
I'd offer to create a PR to have an option to include node_modules, but before I'd like to ask for the reason why the dependencies aren't bundled.
Beta Was this translation helpful? Give feedback.
All reactions