UNPKG

1.02 kBMarkdownView Raw
1# webpack-livereload-plugin
2
3LiveReload when running `webpack --watch`
4
5## Installation
6
7Install the package
8
9```
10npm install --save-dev webpack-livereload-plugin
11```
12
13Add the plugin to your webpack config
14
15```js
16// webpack.config.js
17
18var LiveReloadPlugin = require('webpack-livereload-plugin');
19
20module.exports = {
21 plugins: [
22 new LiveReloadPlugin(options)
23 ]
24}
25```
26
27Add a script tag to your page pointed at the livereload server
28
29```html
30<script src="http://localhost:35729/livereload.js"></script>
31```
32
33
34## Options
35
36- `port` - (Default: 35729) The desired port for the livereload server
37- `appendScriptTag` - (Default: false) Append livereload `<script>`
38 automatically to `<head>`.
39- `ignore` - (Default: `//`) RegExp of files to ignore
40
41## Why?
42
43Yes, there's already `webpack-dev-server` that handles live reloading
44and more complex scenarios. This project aims to solve the case where
45you want assets served by your app server, but still want reloads
46triggered from webpack's build pipeline.