Skip to content

Commit df7ab6e

Browse files
Merge branch 'master' into issue/3575-Error_overlay_html_encodes_the_ansi_html_formatting_the_error_output
2 parents 5cb4923 + 2f54c31 commit df7ab6e

39 files changed

+1063
-627
lines changed

.github/workflows/nodejs.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
uses: actions/setup-node@v2
3636
with:
3737
node-version: ${{ matrix.node-version }}
38+
cache: "npm"
3839

3940
- name: Use latest NPM
4041
run: sudo npm i -g npm
@@ -49,7 +50,7 @@ jobs:
4950
run: npm audit --production
5051

5152
- name: Check commit message
52-
uses: wagoid/commitlint-github-action@v1
53+
uses: wagoid/commitlint-github-action@v4
5354

5455
test:
5556
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
@@ -69,6 +70,7 @@ jobs:
6970
uses: actions/setup-node@v2
7071
with:
7172
node-version: ${{ matrix.node-version }}
73+
cache: "npm"
7274

7375
- name: Use latest NPM on ubuntu/macos
7476
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
@@ -78,36 +80,25 @@ jobs:
7880
if: matrix.os == 'windows-latest'
7981
run: npm i -g npm
8082

81-
- name: Get npm cache directory
82-
id: npm-cache-dir
83-
run: |
84-
echo "::set-output name=dir::$(npm config get cache)"
85-
86-
- name: Cache Node.js modules
87-
id: cache
88-
uses: actions/cache@v2
89-
with:
90-
path: ${{ steps.npm-cache-dir.outputs.dir }}
91-
key: ${{ runner.os }}-${{ matrix.webpack-version }}-node-${{ hashFiles('**/package-lock.json') }}
92-
restore-keys: |
93-
${{ runner.os }}-${{ matrix.webpack-version }}-node-
94-
9583
- name: Install dependencies
9684
run: npm ci
9785

9886
- name: Install webpack ${{ matrix.webpack-version }}
9987
if: matrix.webpack-version == '4'
100-
run: npm i webpack@${{ matrix.webpack-version }}
88+
run: npm i webpack@${{ matrix.webpack-version }} --save-dev --ignore-scripts
10189

10290
- name: Link webpack-dev-server
10391
run: |
104-
npm link --ignore-scripts # do not build the client again
105-
npm link webpack-dev-server
92+
cp -R client tmp-client
93+
npm link --ignore-scripts
94+
npm link webpack-dev-server --ignore-scripts
95+
rm -r client
96+
cp -R tmp-client client
10697
10798
- name: Run tests for webpack version ${{ matrix.webpack-version }}
10899
run: npm run test:coverage -- --ci
109100

110101
- name: Submit coverage data to codecov
111-
uses: codecov/codecov-action@v1
102+
uses: codecov/codecov-action@v2
112103
with:
113104
token: ${{ secrets.CODECOV_TOKEN }}

lib/Server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const os = require("os");
44
const path = require("path");
55
const url = require("url");
6+
const util = require("util");
67
const fs = require("graceful-fs");
78
const ipaddr = require("ipaddr.js");
89
const internalIp = require("internal-ip");
@@ -18,7 +19,16 @@ if (!process.env.WEBPACK_SERVE) {
1819
class Server {
1920
constructor(options = {}, compiler) {
2021
// TODO: remove this after plugin support is published
22+
2123
if (options.hooks) {
24+
const showDeprecationWarning = util.deprecate(
25+
() => {},
26+
"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument.",
27+
"DEP_WEBPACK_DEV_SERVER_API"
28+
);
29+
30+
showDeprecationWarning();
31+
2232
[options, compiler] = [compiler, options];
2333
}
2434

migration-v4.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,51 @@ module.exports = {
443443
- Many CLI options were renamed in favor of the above change, please use `webpack serve --help` to get a list of them.
444444
- The `stdin` option was removed in favor of `--watch-options-stdin`.
445445
- `injectClient` and `injectHot` were removed in favor of manual setup entries.
446+
447+
- `injectClient: false` was replaced with `client: false`:
448+
449+
v3:
450+
451+
```js
452+
module.exports = {
453+
devServer: {
454+
injectClient: false,
455+
},
456+
};
457+
```
458+
459+
v4:
460+
461+
```js
462+
module.exports = {
463+
devServer: {
464+
client: false,
465+
},
466+
};
467+
```
468+
469+
- `injectHot: false` is now assumed when `hot: false` is used:
470+
471+
v3:
472+
473+
```js
474+
module.exports = {
475+
devServer: {
476+
injectHot: false,
477+
},
478+
};
479+
```
480+
481+
v4:
482+
483+
```js
484+
module.exports = {
485+
devServer: {
486+
hot: false,
487+
},
488+
};
489+
```
490+
446491
- The `sockWrite` public method was renamed to `sendMessage`.
447492
- The `profile` option was removed in favor [`ProfilingPlugin`](https://webpack.js.org/plugins/profiling-plugin/).
448493

@@ -500,3 +545,21 @@ There are a lot of other bug fixes.
500545
```
501546

502547
IE8 is not supported, sorry
548+
549+
- Change in **Node.js API**:
550+
551+
- If you're using dev-server through the Node.js API, the options in devServer will be ignored. Pass the options as a first parameter instead:
552+
553+
v3:
554+
555+
```js
556+
new WebpackDevServer(compiler, {...})
557+
```
558+
559+
v4:
560+
561+
```js
562+
new WebpackDevServer({...}, compiler)
563+
```
564+
565+
- [See here](https://github.com/webpack/webpack-dev-server/tree/master/examples/api/simple) for an example of how to use `webpack-dev-server` through the Node.js API.

0 commit comments

Comments
 (0)