1 | # webpack-livereload-plugin
|
2 |
|
3 | LiveReload when running `webpack --watch`
|
4 |
|
5 | ## Installation
|
6 |
|
7 | Install the package
|
8 |
|
9 | ```
|
10 | npm install --save-dev webpack-livereload-plugin
|
11 | ```
|
12 |
|
13 | Add the plugin to your webpack config
|
14 |
|
15 | ```js
|
16 | // webpack.config.js
|
17 |
|
18 | var LiveReloadPlugin = require('webpack-livereload-plugin');
|
19 |
|
20 | module.exports = {
|
21 | plugins: [
|
22 | new LiveReloadPlugin(options)
|
23 | ]
|
24 | }
|
25 | ```
|
26 |
|
27 | Add 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 |
|
43 | Yes, there's already `webpack-dev-server` that handles live reloading
|
44 | and more complex scenarios. This project aims to solve the case where
|
45 | you want assets served by your app server, but still want reloads
|
46 | triggered from webpack's build pipeline.
|