Skip to content

Commit

Permalink
docs(devserver): add documentation for liveReload option (#3051)
Browse files Browse the repository at this point in the history
* chore(docs): add documentation for liveReload option

* test: fix line endings

* docs: update the description with more details

* docs: fix grammer & rephrase docs
  • Loading branch information
EslamHiko authored and EugeneHlushko committed Jun 11, 2019
1 parent 91ce9d2 commit cb09057
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
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

0 comments on commit cb09057

Please sign in to comment.