Skip to content

Commit d502849

Browse files
committed
feat: upgrade webpack-dev-server to 5.2.0
1 parent b9436cc commit d502849

File tree

57 files changed

+279
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+279
-163
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
"use strict";
2+
13
console.log("Bar.");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
"use strict";
2+
13
console.log("Hey.");
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
const HTMLGeneratorPlugin = require("../../helpers/html-generator-plugin");
24

35
module.exports = {
@@ -7,13 +9,13 @@ module.exports = {
79
stats: "none",
810
entry: "./foo.js",
911
output: {
10-
path: "/",
12+
path: "/"
1113
},
1214
infrastructureLogging: {
1315
level: "info",
1416
stream: {
15-
write: () => {},
16-
},
17+
write: () => {}
18+
}
1719
},
18-
plugins: [new HTMLGeneratorPlugin()],
20+
plugins: [new HTMLGeneratorPlugin()]
1921
};

tests/fixtures/custom-client/CustomSockJSClient.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
/**
2+
* Copy from webpack-dev-server
3+
*/
4+
5+
"use strict";
6+
17
const SockJS = require("sockjs-client/dist/sockjs");
28

39
module.exports = class SockJSClient {
410
constructor(url) {
511
this.sock = new SockJS(
6-
url.replace(/^ws:/i, "http://").replace(/^wss:/i, "https://"),
12+
url.replace(/^ws:/i, "http://").replace(/^wss:/i, "https://")
713
);
814
}
915

@@ -23,7 +29,7 @@ module.exports = class SockJSClient {
2329

2430
// call f with the message string as the first argument
2531
onMessage(f) {
26-
this.sock.onmessage = (e) => {
32+
this.sock.onmessage = e => {
2733
const obj = JSON.parse(e.data);
2834
console.log(obj.type);
2935
f(e.data);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
"use strict";
2+
13
console.log("Hey.");
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
"use strict";
2+
13
module.exports = {
24
mode: "development",
35
context: __dirname,
46
stats: "none",
57
entry: "./foo.js",
68
output: {
7-
path: "/",
9+
path: "/"
810
},
911
infrastructureLogging: {
10-
level: "warn",
11-
},
12+
level: "warn"
13+
}
1214
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
require("./bar.html");
24

35
console.log("Hey.");
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
"use strict";
2+
13
const moduleRuleForHTML = {
24
test: /\.html$/,
35
type: "asset/resource",
46
generator: {
5-
filename: "index.html",
6-
},
7+
filename: "index.html"
8+
}
79
};
810

911
module.exports = {
@@ -12,16 +14,16 @@ module.exports = {
1214
stats: "none",
1315
entry: "./foo.js",
1416
output: {
15-
path: "/",
17+
path: "/"
1618
},
1719
module: {
1820
rules: [
1921
{
20-
...moduleRuleForHTML,
21-
},
22-
],
22+
...moduleRuleForHTML
23+
}
24+
]
2325
},
2426
infrastructureLogging: {
25-
level: "warn",
26-
},
27+
level: "warn"
28+
}
2729
};

tests/fixtures/historyapifallback-config/foo.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
require("./index.html");
24
require("./bar.html");
35

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
"use strict";
2+
13
const moduleRuleForHTML = {
24
test: /\.html$/,
35
type: "asset/resource",
46
generator: {
5-
filename: "[name][ext]",
6-
},
7+
filename: "[name][ext]"
8+
}
79
};
810

911
module.exports = {
@@ -12,16 +14,16 @@ module.exports = {
1214
stats: "none",
1315
entry: "./foo.js",
1416
output: {
15-
path: "/",
17+
path: "/"
1618
},
1719
module: {
1820
rules: [
1921
{
20-
...moduleRuleForHTML,
21-
},
22-
],
22+
...moduleRuleForHTML
23+
}
24+
]
2325
},
2426
infrastructureLogging: {
25-
level: "warn",
26-
},
27+
level: "warn"
28+
}
2729
};

0 commit comments

Comments
 (0)