Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(devserver): add documentation for liveReload option #3051

Merged
merged 8 commits into from Jun 11, 2019
2 changes: 2 additions & 0 deletions src/content/api/cli.md
Expand Up @@ -11,6 +11,7 @@ contributors:
- EugeneHlushko
- byzyk
- wizardofhogwarts
- EslamHiko
related:
- title: Analyzing Build Statistics
url: https://survivejs.com/webpack/optimizing-build/analyzing-build-statistics/
Expand Down Expand Up @@ -299,6 +300,7 @@ Parameter | Explanation | Usage
`--define` | Define any free variable, see [shimming](/guides/shimming) | `--define process.env.NODE_ENV="'development'"`
`--hot` | Enables [Hot Module Replacement](/concepts/hot-module-replacement) | `--hot=true`
`--labeled-modules` | Enables labeled modules [Uses LabeledModulesPlugin] |
`--live-reload` | Enables live reloading | `--live-reload=true`
`--plugin` | Load this [plugin](/configuration/plugins/) |
`--prefetch` | Prefetch the particular file | `--prefetch=./files.js`
`--provide` | Provide these modules as globals, see [shimming](/guides/shimming) | `--provide jQuery=jquery`
Expand Down
24 changes: 24 additions & 0 deletions src/content/configuration/dev-server.md
Expand Up @@ -696,6 +696,30 @@ T> [`watchOptions`](#devserver-watchoptions-) will have no effect when used with

T> If you use the CLI, make sure __inline mode__ is disabled.

## `devServer.liveReload`

`boolean: true`

By default, the dev-server will reload/refresh the page when file changes are detected. [`devServer.hot`](#devserverhot) option must be disabled or [`devServer.watchContentBase`](#devserverwatchcontentbase) option must be enabled in order for `liveReload` to take effect. Disable `devServer.liveReload` by setting it to `false`:


__webpack.config.js__

```javascript
module.exports = {
//...
devServer: {
liveReload: false
}
};
```

Usage via the CLI

```bash
webpack-dev-server --no-live-reload
```


## `devServer.mimeTypes` 🔑

Expand Down