1
votes

I am using electron-builder 22.6.0 to create mas build but .app file does not include nested node_modules (node_modules of myApp). I have tried using extraFiles in package.json it creates a folder in Resources and copy all the node_modules in that but still getting 404.

My package.json:

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

Folder structure:

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

How can I include node_modules by default? My electron version is 8.2.0

1

1 Answers

1
votes

Electron-builder will pack the node_modules by removing the dev node dependencies and unused modules. We don't need to do this manually.

If you still want to include this in your package, add this to your electron-builder configuration: "files": ["node_modules/**/*"]