|
2 | 2 |
|
3 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4 | 4 |
|
| 5 | +## [4.0.0-beta.0](https://github.com/webpack/webpack-dev-server/compare/v3.11.0...v4.0.0-beta.0) (2020-11-27) |
| 6 | + |
| 7 | +### ⚠ BREAKING CHANGES |
| 8 | + |
| 9 | +* drop support `Node.js@6` and `Node.js@8`, minimum supported `Node.js` version is `Node@10` |
| 10 | +* the `hot` option is `true` by default |
| 11 | +* the `hotOnly` option was removed, if you need hot only mode, use `hot: 'only'` value |
| 12 | +* the default `transportMode` is switched from `sockjs` to `ws` (IE 11 and other old browsers doesn't support WebSocket, set `sockjs` value for `transportMode` if you need supports IE 11) |
| 13 | +* `before`, `after` and `setup` were removed in favor `onBeforeSetupMiddleware` (previously `before`) and `onAfterSetupMiddleware` options (previously `after`) |
| 14 | +* the `clientOptions` was renamed to the `client` option |
| 15 | +* the `key`, `cert`, `pfx`, `pfx-passphrase`, `cacert`, `ca` and `requestCert` options were moved to `https` options, please use `https.{key|cert|pfx|passphrase|requestCert|cacert|ca|requestCert}` |
| 16 | +* the `sockHost`, `sockPath` and `sockPort` options were removed in `client` option |
| 17 | +* the `inline` option (`iframe` live mode) was removed |
| 18 | +* the `lazy` and `filename` options were removed |
| 19 | +* the `features` option was removed |
| 20 | +* the `log`, `logLevel`, `logTime`, `noInfo`, `quiet`, `reporter` and `warn` options were removed in favor of built-in webpack logger, please read [this](https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel) to enable and setup logging output |
| 21 | +* the `fs`, `index`, `mimeTypes`, `publicPath`, `serverSideRender`, and `writeToDisk` options were moved in the `dev` option (`webpack-dev-middleware` options) |
| 22 | +* updating `webpack-dev-middleware` to v4, which includes many breaking options changes, please [read](https://github.com/webpack/webpack-dev-middleware/releases) |
| 23 | +* the `stats` option was removed, please use the [`stats`](https://webpack.js.org/configuration/stats/) option from `webpack.config.js` |
| 24 | +* the `socket` option was removed |
| 25 | +* the `contentBase`, `contentBasePublicPath`, `serveIndex`, `staticOptions`, `watchContentBase`, `watchOptions` were removed in favor of the `static` option |
| 26 | +* the `disableHostCheck` and `allowedHosts` options were removed in favor of the `firewall` option |
| 27 | +* `server.listen()` will find free port if the `port` is not set and the `port` argument is not passed, also print a warning if the `port` option and the `port` argument passed to `server.listen()` are different |
| 28 | +* the `progress` option is moved to the `client` option, set `client: {progress: true}` |
| 29 | +* the `profile` option was removed, to print profile data, set `client: { progress: 'profile' }` |
| 30 | +* client uses the port of the current location (`location.port`, equivalent to `sockPort: 'location'`), by default. To get previously behavior, set the `client.port` with the port you'd like to set |
| 31 | +* client uses the hostname of the current location (`location.hostname`), by default. To get previously behavior, set the `client.host` with the hostname you'd like to set |
| 32 | + |
| 33 | +### Features |
| 34 | + |
| 35 | +* compatibility with `webpack@5` |
| 36 | +* compatibility with `webpack-cli@4` |
| 37 | +* added the `setupExitSignals` option, it takes a boolean and if true (default on CLI), the server will close and exit the process on SIGINT and SIGTERM |
| 38 | +* update `chokidar` to v3 |
| 39 | + |
| 40 | +### Notes |
| 41 | + |
| 42 | +Unfortunately, due to the huge amount of changes it is very difficult to display all changes in a convenient form. Therefore, we offer you a couple of popular examples (feel free to send a PR with more examples). |
| 43 | + |
| 44 | +#### `static` |
| 45 | + |
| 46 | +Previously `contentBase`, `contentBasePublicPath`, `serveIndex`, `staticOptions`, `watchContentBase` and `watchOptions` |
| 47 | + |
| 48 | +```js |
| 49 | +module.exports = { |
| 50 | + // ... |
| 51 | + devServer: { |
| 52 | + // Can be: |
| 53 | + // static: path.resolve(__dirname, 'static') |
| 54 | + // static: false |
| 55 | + static: [ |
| 56 | + // Simple example |
| 57 | + path.resolve(__dirname, 'static'), |
| 58 | + // Complex example |
| 59 | + { |
| 60 | + directory: path.resolve(__dirname, 'static'), |
| 61 | + staticOptions: {}, |
| 62 | + // Don't be confused with `dev.publicPath`, it is `publicPath` for static directory |
| 63 | + // Can be: |
| 64 | + // publicPath: ['/static-public-path-one/', '/static-public-path-two/'], |
| 65 | + publicPath: '/static-public-path/', |
| 66 | + // Can be: |
| 67 | + // serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index) |
| 68 | + serveIndex: true, |
| 69 | + // Can be: |
| 70 | + // watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar) |
| 71 | + watch: true, |
| 72 | + }, |
| 73 | + ], |
| 74 | + }, |
| 75 | +}; |
| 76 | +``` |
| 77 | + |
| 78 | +#### `publicPath` |
| 79 | + |
| 80 | +```js |
| 81 | +module.exports = { |
| 82 | + // ... |
| 83 | + devServer: { |
| 84 | + dev: { |
| 85 | + publicPath: '/publicPathForDevServe', |
| 86 | + }, |
| 87 | + }, |
| 88 | +}; |
| 89 | +``` |
| 90 | + |
| 91 | +#### `firewall` |
| 92 | + |
| 93 | +Previously `disableHostCheck` and `allowedHosts` |
| 94 | + |
| 95 | +```js |
| 96 | +module.exports = { |
| 97 | + // ... |
| 98 | + devServer: { |
| 99 | + dev: { |
| 100 | + // Can be |
| 101 | + // firewall: ['192.168.0.1', 'domain.com'] |
| 102 | + firewall: false, |
| 103 | + }, |
| 104 | + }, |
| 105 | +}; |
| 106 | +``` |
| 107 | + |
| 108 | +#### logging |
| 109 | + |
| 110 | +```js |
| 111 | +module.exports = { |
| 112 | + // ... |
| 113 | + infrastructureLogging: { |
| 114 | + // Only warnings and errors |
| 115 | + // level: 'none' disable logging |
| 116 | + // Please read https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel |
| 117 | + level: 'warn', |
| 118 | + }, |
| 119 | +}; |
| 120 | +``` |
| 121 | + |
5 | 122 | ## [3.11.0](https://github.com/webpack/webpack-dev-server/compare/v3.10.3...v3.11.0) (2020-05-08)
|
6 | 123 |
|
7 | 124 |
|
|
0 commit comments