ttay24-webpack-electron-reload
v1.1.1
Published
Webpack plugin which restarts electron process on recompile
Downloads
3
Maintainers
Readme
Forked from https://github.com/tverdohleb/webpack-electron-reload. This package adds the ability to pass in arguments to electron. For example: electron ./dist/main.js some-arg
webpack-electron-reload
Webpack plugin that restarts Electron main process automatically on webpack build. Inspired by electron-reload-webpack-plugin.
Installation
npm install --save-dev ttay24-webpack-electron-reload
Usage
Add plugin to webpack config
const path = require('path');
const ElectronReloadPlugin = require('webpack-electron-reload')({
path: path.join(__dirname, './dist/main.js'),
args: ['some', 'args'],
});
module.exports = {
// ...
target: 'electron-main',
plugins: [
// ...
ElectronReloadPlugin()
],
// ...
};
Start webpack with 'watch' option
webpack --watch
Plugin will start/restart electron app when webpack rebuilds sources.