webpack-electron-connect-plugin
v1.0.4
Published
webpack plugin to reload and restart Electron
Downloads
9
Maintainers
Readme
webpack-electron-connect-plugin
webpack plugin to reload and restart Electron
requires electron-connect package
Installation
npm install --save-dev electron-connect webpack-electron-connect-plugin
or
yarn add --dev electron-connect webpack-electron-connect-plugin
Usage
Electron renderer process
<html>
<body>
<!-- add script -->
<script>require('electron-connect').client.create()</script>
</body>
</html>
webpack.config
const ElectronConnectPlugin = require("webpack-electron-connect-plugin");
{
// ...
plugins: [
new ElectronConnectPlugin({
type: "reload", // "reload" or "restart"
options: {}
})
];
}
use webpack watch option
webpack -w
API
type
// Not kill Electron process. reload Electron
{
type: "reload",
}
// Kill Electron process. restart Electron
{
type: "restart",
}
options
check server.create([options]) from npm electron-connect page
// example
{
options: {
port: 30080, // WebSocket server port (default: 30080)
}
}
License
MIT