electron-reload-webpack-plugin
Webpack plugin that reloads Electron main or renderer process on build. Powered by electron-connect
Installation
npm install --save-dev electron-reload-webpack-plugin
Usage
webpack.config.js
1. Add plugin to const path = ;const createElectronReloadWebpackPlugin = ; // Create one plugin for both renderer and main processconst ElectronReloadWebpackPlugin = ; moduleexports = // ... // Target is recommended to be `electron-main` or `electron-renderer` // Usually you want to have two webpack configs, one for renderer and other one for main process target: 'electron-renderer' plugins: // ... // Call created plugin here // If your config `target` is different from recommended one then you should also specify it like this `ElectronReloadWebpackPlugin('electron-renderer')` // ...;
electron-connect
client if you need to reload renderer process
1.1 Create ;; app;
2. Start webpack with watch option
$ webpack --watch
Examples
Check webpack.config.js
example in examples folder