question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron Auto-reload on changes

See original GitHub issue

So you describe a hot reload on the readme. Is the angular reload meant by that? this works fine, but is there a way to recompile electron easier without ending and restarting it with npm start? Or is there a watch mode i have not seen?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Kaffiendcommented, Aug 9, 2018

install nodemon globally, or as a dev dep either will work.

npm i -g nodemon

then just change this line in package.json to this.

"electron:serve": "wait-on http-get://localhost:4200/ && npm run electron:tsc && nodemon --watch ./main.ts --exec \"npm run electron:tsc && electron . \"",

This will watch the main.ts electron process file. when you save changes nodemon will run the -exec override and recompile the electron main process code and restart it.

1reaction
Kaffiendcommented, Aug 7, 2018

There are a couple options, the watchmode for electron i’m not familiar with but you can use a lib like nodemon manage the electron process in development. Tell it to watch the electron files and give it an execute of tsc ./path/to/electron/main and it will kill the main process, compile and run again. the other is with a task runner that has watching, like gulp etc. you can make it watch and kill the process and fire off the build and run again. Does this answer your question?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use live reload in your Electron Project | Our Code World
Learn how to reload your electron project automatically when you make a change without rebuild electron. How to use live reload in your ......
Read more >
How to set up hot reload on Electron - Flavio Copes
When working on an Electron app, it's very handy to set up hot reload, so that the application updates without having to restart...
Read more >
electron-reload - npm
Simplest way to reload an electron app on file changes! ... Start using electron-reload in your project by running `npm i electron-reload`.
Read more >
Hot Reload in ElectronJS - GeeksforGeeks
Approach 1: Using electron-reload npm package. This package is used to load the contents of all active BrowserWindow Instances within Electron ...
Read more >
sindresorhus/electron-reloader: Simple auto ... - GitHub
Simple auto-reloading for Electron apps during development. It just works. When files used in the main process are changed, the app is restarted, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found