Webpack plugin that reloads Electron main process.
Use NPM in order to install the package as dependecy.
npm install -D electron-reloader-webpack-plugin
Add plugin to your webpack config
const ElectronReloaderPlugin = require('electron-reloader-webpack-plugin');
module.exports = {
plugins: [
// ...
// Call ElectronReloader here
new ElectronReloaderPlugin('electron', ['.'])
// another example
new ElectronReloaderPlugin('npm', ['run', 'electron:start'])
// In first argument you define what command to use and the second argument what args want to use.
]
};
Start webpack with watch option
webpack --watch