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 page live reloading | `--live-reload=true`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`--live-reload` | Enables page live reloading | `--live-reload=true`
`--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
23 changes: 23 additions & 0 deletions src/content/configuration/dev-server.md
Expand Up @@ -659,6 +659,29 @@ 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`

When `devServer.liveReload` is disabled, the dev-server will never reload/refresh the page.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never appears to be a bit awkward.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wizardofhogwarts i updated the description with more detailed one, can you please check it ? thanks.


__webpack.config.js__

```javascript
module.exports = {
//...
devServer: {
liveReload: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
liveReload: true
liveReload: false

}
};
```

Usage via the CLI

```bash
webpack-dev-server --live-reload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this default? Why we need to pass it

```


## `devServer.mimeTypes` 🔑

Expand Down