Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tverdohleb/webpack-electron-reload

Webpack plugin to restart electron process automatically on code changes
https://github.com/tverdohleb/webpack-electron-reload

electron livereload reload restart webpack webpack-plugin

Last synced: 3 months ago
JSON representation

Webpack plugin to restart electron process automatically on code changes

Awesome Lists containing this project

README

        

[npm_img]: https://img.shields.io/npm/v/webpack-electron-reload.svg?style=flat-square
[npm_site]: https://www.npmjs.org/package/webpack-electron-reload

[![npm info][npm_img]][npm_site]

# webpack-electron-reload
[Webpack](https://webpack.js.org/) plugin that restarts [Electron](https://electronjs.org/) main process automatically on webpack build. Inspired by [electron-reload-webpack-plugin](https://github.com/O4epegb/electron-reload-webpack-plugin).

## Installation
```
npm install --save-dev 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'),
});

module.exports = {
// ...

target: 'electron-main',

plugins: [
// ...
ElectronReloadPlugin()
],

// ...
};
```

### Start webpack with 'watch' option
```
webpack --watch
```

Plugin will start/restart electron app when webpack rebuilds sources.