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

330
Vistas
How to run an Electron application from source (not bundle)

I'm new to Electron, and trying to help maintain an application whose developer has left. The resources/app folder consists of (at least) three things:

  • The app/lib/bundle.js, which contains the entire application, bundled and minified. This is what the app seems to actually run.
  • Node modules for all the code written by the developer. These are in TypeScript, and are in the structure node_modules/@mainmodule/submodule/src/.../something.ts. Each of these also has a node_modules/@mainmodule/submodule/package.json and node_modules/@mainmodule/submodule/tsconfig.json
  • Finally, for each of these, a corresponding lib folder: node_modules/@mainmodule/submodule/src/.../something.js. The lib folder has Javascript corresponding to each of the TypeScript, as well as map files showing how they correspond. It is these Javascript files that are minified and included in the bundle, which is actually run.

The source TypeScript is relatively clear and I can follow most of it. But to really understand it I need to set breakpoints on it and run it in a debugger (e.g. VS Code). However, when running the app, Electron doesn't run it from the TypeScript (in src), or even the individual Javascript (in lib), but rather from bundle.js. Bundle.js is a giant file that, besides being minified, is too big to even load properly in my editor.

My question

How can I tell Electron to run the app not from the bundle.js, but from the individual src/...ts TypeScript, or, failing that, from the individual src/...js JavaScript?

If that's not possible, what is the proper way to use a debugger, given the source, when the Electron application is bundled? I have full source but, when I invoke Electron, it runs out of the bundle: how I can change this?

I'm new to Electron and Node, so if I'm making an elementary mistake, please clarify.


Update with progress so far

I've made a lot of progress in getting down to source, but not all the way there.

The Electron app starts with electron-main.js, which loads things like server.js and other files. These all run from source.

Eventually, it creates a minimal window with the following code:

<head>
...
  <script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
</head>

bundle.js is then loaded in the window. The files is far too big and unscrutable (minified) to be of much use. But, as I said, the source is all available too.

However, bundle.map.js contains is complete: it contains sources, names, mappings, sourcesContent, which is enough, in principle, to reconstruct everything. Moreover, for almost all of the sources, the corresponding source file is available and obvious.

I believe I need to replace the <script type="text/javascript" src="./bundle.js" charset="utf-8"></script> with a includer.js which:

  • Includes all files for which I can figure out their matching source file
  • Uses the sourcesContent for anything else

/Progress to date...

over 4 years ago · Santiago Trujillo
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