Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

297
Vistas
Does Production Electron need node_modules/

Been working on a Electron and React app for the past 4 months and we are getting close to releasing it. This is my first production Electron app and I noticed the unpacked size was very large and the app.asar contained over 100mb of node_modules.

  • My colleague wrote the electron-builder config (probably just boilerplate code - Python dev) and it includes the react build/ and node_modules/ in the electron build. I understand React doesn't need any Node_modules once it is built because all of the code is bundled and a majority of these node_modules are for the react app.
  • I would assume it would be the same after electron is built/compiled. Or is it needed for nodejs deps? For the testing I did today I moved all of the react app's deps into devDeps so electron-builder doesn't include them. It reduced the unpacked size by over 80% (over 500mb to under 150mb) because it included a bunch of ui stuff like icons that were tree shaken for the built react app. Inspecting the source tree for the built react app is under 2mb for node_modules.

TLDR: does my built electron app actually need node_modules included in the build (built for linux and armv7l)? I know the react app does not after being built. And my temp work around has been moving my react deps to devDependencies so electron-builder ignores them. -- (I know this is not best practice because deploying the react app alone with a lot of services will only read the production dependencies - but shouldn't be an issue for our app's deployment)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No, you should not need to include your node_modules in the electron build. Most of the required dependencies should be transpiled into the build folder.

Docs here: https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules

You should also be able to test this our pretty easily. Remove node_modules from the build target and test after running build.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda