diff --git a/src/content/api/cli.md b/src/content/api/cli.md index 189fffca2fb8..729ce52cf978 100644 --- a/src/content/api/cli.md +++ b/src/content/api/cli.md @@ -11,6 +11,7 @@ contributors: - EugeneHlushko - byzyk - wizardofhogwarts + - EslamHiko related: - title: Analyzing Build Statistics url: https://survivejs.com/webpack/optimizing-build/analyzing-build-statistics/ @@ -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` diff --git a/src/content/configuration/dev-server.md b/src/content/configuration/dev-server.md index d3321d5c6cf6..8e2b67c1cf09 100644 --- a/src/content/configuration/dev-server.md +++ b/src/content/configuration/dev-server.md @@ -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` 🔑