Can't use npm modules inside electron.js. _(socket.io for example)_
I know the node_modules are removed in the final build, but they seem to work only when included inside the Vue instance.
Is there some way i can still require these in electron.js?
npm install --save socket.io
cd app
npm install --save socket.io
npm run build:win32
# then execute exe
/app/electron.js
const io = require('socket.io')

@simonwjackson
Any modules required within the scope of app/src/main.js will be bundled with webpack for the renderer process only. Modules required in app/electron.js will not work in production, after making a build. There's currently no plans to support bundling the main process at the moment (more info).
Related:
Ok, i guess ill have to write a script to install dependencies after the build is complete since this is mission critical for my app.
Thanks or the update!
Looking to bring electron-builder support soon, which should make external modules for main process a lot easier to manage. Not many boilerplates handle this well so there is some pioneering to do since webpack is involved. Thanks for understanding.
Most helpful comment
Looking to bring
electron-buildersupport soon, which should make external modules for main process a lot easier to manage. Not many boilerplates handle this well so there is some pioneering to do since webpack is involved. Thanks for understanding.