webpack-dev-server 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/index.js +1 -0
- package/client/modules/strip-ansi/index.js +1 -1
- package/client/utils/reloadApp.js +4 -12
- package/lib/Server.js +11 -19
- package/package.json +1 -1
package/client/index.js
CHANGED
|
@@ -39,7 +39,7 @@ function ansiRegex() {
|
|
|
39
39
|
_ref$onlyFirst = _ref.onlyFirst,
|
|
40
40
|
onlyFirst = _ref$onlyFirst === void 0 ? false : _ref$onlyFirst;
|
|
41
41
|
|
|
42
|
-
var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]
|
|
42
|
+
var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
|
|
43
43
|
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -8,21 +8,13 @@ function reloadApp(_ref, status) {
|
|
|
8
8
|
|
|
9
9
|
if (status.isUnloading) {
|
|
10
10
|
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
}
|
|
13
12
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var isInitial = status.currentHash.indexOf(webpackHash) === 0;
|
|
13
|
+
var currentHash = status.currentHash,
|
|
14
|
+
previousHash = status.previousHash;
|
|
15
|
+
var isInitial = currentHash.indexOf(previousHash) >= 0;
|
|
18
16
|
|
|
19
17
|
if (isInitial) {
|
|
20
|
-
var isLegacyInitial = webpackHash === "" && hot === false && liveReload === true;
|
|
21
|
-
|
|
22
|
-
if (isLegacyInitial) {
|
|
23
|
-
status.previousHash = status.currentHash;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
18
|
return;
|
|
27
19
|
}
|
|
28
20
|
|
package/lib/Server.js
CHANGED
|
@@ -1150,26 +1150,18 @@ class Server {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
1152
|
setupHooks() {
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
this.stats = stats;
|
|
1165
|
-
});
|
|
1166
|
-
};
|
|
1153
|
+
this.compiler.hooks.invalid.tap("webpack-dev-server", () => {
|
|
1154
|
+
if (this.webSocketServer) {
|
|
1155
|
+
this.sendMessage(this.webSocketServer.clients, "invalid");
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
this.compiler.hooks.done.tap("webpack-dev-server", (stats) => {
|
|
1159
|
+
if (this.webSocketServer) {
|
|
1160
|
+
this.sendStats(this.webSocketServer.clients, this.getStats(stats));
|
|
1161
|
+
}
|
|
1167
1162
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
} else {
|
|
1171
|
-
addHooks(this.compiler);
|
|
1172
|
-
}
|
|
1163
|
+
this.stats = stats;
|
|
1164
|
+
});
|
|
1173
1165
|
}
|
|
1174
1166
|
|
|
1175
1167
|
setupHostHeaderCheck() {
|