electron-relaunch

Simplest way to relaunch an electron app on file changes!

Usage no npm install needed!

<script type="module">
  import electronRelaunch from 'https://cdn.skypack.dev/electron-relaunch';
</script>

README

electron relaunch

Disclaimer: this module is in its very early stages and the logic is still not mature enough.

Installation

npm install electron-relaunch

Usage

Just initialize this module with desired glob or file path to watch and let it refresh electron browser windows as targets are changed:

'use strict';

const {app, BrowserWindow} = require('electron');

require('electron-relaunch')(__dirname);

// Standard stuff
app.on('ready', () {
  let mainWindow = new BrowserWindow({width: 800, height: 600});

  mainWindow.loadUrl(`file://${__dirname}/index.html`);
  // the rest...
});