webpack-dev-server 5.0.4 → 5.1.0
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/README.md +1 -1
- package/client/clients/SockJSClient.js +3 -3
- package/client/clients/WebSocketClient.js +3 -3
- package/client/index.js +14 -1
- package/client/modules/logger/index.js +198 -110
- package/client/modules/sockjs-client/index.js +1 -1
- package/client/overlay/fsm.js +1 -1
- package/client/overlay.js +5 -5
- package/client/progress.js +124 -0
- package/client/utils/reloadApp.js +1 -1
- package/lib/Server.js +600 -369
- package/lib/options.json +23 -5
- package/package.json +30 -29
- package/types/bin/cli-flags.d.ts +15 -0
- package/types/lib/Server.d.ts +187 -282
- package/types/lib/servers/WebsocketServer.d.ts +0 -1
|
@@ -30,7 +30,7 @@ function SyncBailHook() {
|
|
|
30
30
|
/*!****************************************************!*\
|
|
31
31
|
!*** ./node_modules/webpack/lib/logging/Logger.js ***!
|
|
32
32
|
\****************************************************/
|
|
33
|
-
/***/ (function(
|
|
33
|
+
/***/ (function(module) {
|
|
34
34
|
|
|
35
35
|
/*
|
|
36
36
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
@@ -39,52 +39,43 @@ function SyncBailHook() {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
function _toConsumableArray(
|
|
43
|
-
return _arrayWithoutHoles(
|
|
42
|
+
function _toConsumableArray(r) {
|
|
43
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
44
44
|
}
|
|
45
45
|
function _nonIterableSpread() {
|
|
46
46
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
47
|
}
|
|
48
|
-
function _unsupportedIterableToArray(
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
48
|
+
function _unsupportedIterableToArray(r, a) {
|
|
49
|
+
if (r) {
|
|
50
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
51
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
52
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
53
|
+
}
|
|
55
54
|
}
|
|
56
|
-
function _iterableToArray(
|
|
57
|
-
if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })
|
|
55
|
+
function _iterableToArray(r) {
|
|
56
|
+
if ("undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && null != r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
58
57
|
}
|
|
59
|
-
function _arrayWithoutHoles(
|
|
60
|
-
if (Array.isArray(
|
|
58
|
+
function _arrayWithoutHoles(r) {
|
|
59
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
61
60
|
}
|
|
62
|
-
function _arrayLikeToArray(
|
|
63
|
-
|
|
64
|
-
for (var
|
|
65
|
-
return
|
|
61
|
+
function _arrayLikeToArray(r, a) {
|
|
62
|
+
(null == a || a > r.length) && (a = r.length);
|
|
63
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
64
|
+
return n;
|
|
66
65
|
}
|
|
67
|
-
function _classCallCheck(
|
|
68
|
-
if (!(
|
|
69
|
-
throw new TypeError("Cannot call a class as a function");
|
|
70
|
-
}
|
|
66
|
+
function _classCallCheck(a, n) {
|
|
67
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
71
68
|
}
|
|
72
|
-
function _defineProperties(
|
|
73
|
-
for (var
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
descriptor.configurable = true;
|
|
77
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
78
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
69
|
+
function _defineProperties(e, r) {
|
|
70
|
+
for (var t = 0; t < r.length; t++) {
|
|
71
|
+
var o = r[t];
|
|
72
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
79
73
|
}
|
|
80
74
|
}
|
|
81
|
-
function _createClass(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
writable: false
|
|
86
|
-
});
|
|
87
|
-
return Constructor;
|
|
75
|
+
function _createClass(e, r, t) {
|
|
76
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
77
|
+
writable: !1
|
|
78
|
+
}), e;
|
|
88
79
|
}
|
|
89
80
|
function _toPropertyKey(t) {
|
|
90
81
|
var i = _toPrimitive(t, "string");
|
|
@@ -101,40 +92,40 @@ function _toPrimitive(t, r) {
|
|
|
101
92
|
return ("string" === r ? String : Number)(t);
|
|
102
93
|
}
|
|
103
94
|
var LogType = Object.freeze({
|
|
104
|
-
error: (
|
|
95
|
+
error: (/** @type {"error"} */"error"),
|
|
105
96
|
// message, c style arguments
|
|
106
|
-
warn: (
|
|
97
|
+
warn: (/** @type {"warn"} */"warn"),
|
|
107
98
|
// message, c style arguments
|
|
108
|
-
info: (
|
|
99
|
+
info: (/** @type {"info"} */"info"),
|
|
109
100
|
// message, c style arguments
|
|
110
|
-
log: (
|
|
101
|
+
log: (/** @type {"log"} */"log"),
|
|
111
102
|
// message, c style arguments
|
|
112
|
-
debug: (
|
|
103
|
+
debug: (/** @type {"debug"} */"debug"),
|
|
113
104
|
// message, c style arguments
|
|
114
105
|
|
|
115
|
-
trace: (
|
|
106
|
+
trace: (/** @type {"trace"} */"trace"),
|
|
116
107
|
// no arguments
|
|
117
108
|
|
|
118
|
-
group: (
|
|
109
|
+
group: (/** @type {"group"} */"group"),
|
|
119
110
|
// [label]
|
|
120
|
-
groupCollapsed: (
|
|
111
|
+
groupCollapsed: (/** @type {"groupCollapsed"} */"groupCollapsed"),
|
|
121
112
|
// [label]
|
|
122
|
-
groupEnd: (
|
|
113
|
+
groupEnd: (/** @type {"groupEnd"} */"groupEnd"),
|
|
123
114
|
// [label]
|
|
124
115
|
|
|
125
|
-
profile: (
|
|
116
|
+
profile: (/** @type {"profile"} */"profile"),
|
|
126
117
|
// [profileName]
|
|
127
|
-
profileEnd: (
|
|
118
|
+
profileEnd: (/** @type {"profileEnd"} */"profileEnd"),
|
|
128
119
|
// [profileName]
|
|
129
120
|
|
|
130
|
-
time: (
|
|
121
|
+
time: (/** @type {"time"} */"time"),
|
|
131
122
|
// name, time as [seconds, nanoseconds]
|
|
132
123
|
|
|
133
|
-
clear: (
|
|
124
|
+
clear: (/** @type {"clear"} */"clear"),
|
|
134
125
|
// no arguments
|
|
135
|
-
status: (
|
|
126
|
+
status: (/** @type {"status"} */"status") // message, arguments
|
|
136
127
|
});
|
|
137
|
-
exports.LogType = LogType;
|
|
128
|
+
module.exports.LogType = LogType;
|
|
138
129
|
|
|
139
130
|
/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */
|
|
140
131
|
|
|
@@ -151,6 +142,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
151
142
|
this[LOG_SYMBOL] = log;
|
|
152
143
|
this.getChildLogger = getChildLogger;
|
|
153
144
|
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @param {...any} args args
|
|
148
|
+
*/
|
|
154
149
|
return _createClass(WebpackLogger, [{
|
|
155
150
|
key: "error",
|
|
156
151
|
value: function error() {
|
|
@@ -159,6 +154,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
159
154
|
}
|
|
160
155
|
this[LOG_SYMBOL](LogType.error, args);
|
|
161
156
|
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @param {...any} args args
|
|
160
|
+
*/
|
|
162
161
|
}, {
|
|
163
162
|
key: "warn",
|
|
164
163
|
value: function warn() {
|
|
@@ -167,6 +166,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
167
166
|
}
|
|
168
167
|
this[LOG_SYMBOL](LogType.warn, args);
|
|
169
168
|
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @param {...any} args args
|
|
172
|
+
*/
|
|
170
173
|
}, {
|
|
171
174
|
key: "info",
|
|
172
175
|
value: function info() {
|
|
@@ -175,6 +178,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
175
178
|
}
|
|
176
179
|
this[LOG_SYMBOL](LogType.info, args);
|
|
177
180
|
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @param {...any} args args
|
|
184
|
+
*/
|
|
178
185
|
}, {
|
|
179
186
|
key: "log",
|
|
180
187
|
value: function log() {
|
|
@@ -183,6 +190,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
183
190
|
}
|
|
184
191
|
this[LOG_SYMBOL](LogType.log, args);
|
|
185
192
|
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @param {...any} args args
|
|
196
|
+
*/
|
|
186
197
|
}, {
|
|
187
198
|
key: "debug",
|
|
188
199
|
value: function debug() {
|
|
@@ -191,6 +202,11 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
191
202
|
}
|
|
192
203
|
this[LOG_SYMBOL](LogType.debug, args);
|
|
193
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {any} assertion assertion
|
|
208
|
+
* @param {...any} args args
|
|
209
|
+
*/
|
|
194
210
|
}, {
|
|
195
211
|
key: "assert",
|
|
196
212
|
value: function assert(assertion) {
|
|
@@ -211,6 +227,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
211
227
|
value: function clear() {
|
|
212
228
|
this[LOG_SYMBOL](LogType.clear);
|
|
213
229
|
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @param {...any} args args
|
|
233
|
+
*/
|
|
214
234
|
}, {
|
|
215
235
|
key: "status",
|
|
216
236
|
value: function status() {
|
|
@@ -219,6 +239,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
219
239
|
}
|
|
220
240
|
this[LOG_SYMBOL](LogType.status, args);
|
|
221
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @param {...any} args args
|
|
245
|
+
*/
|
|
222
246
|
}, {
|
|
223
247
|
key: "group",
|
|
224
248
|
value: function group() {
|
|
@@ -227,6 +251,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
227
251
|
}
|
|
228
252
|
this[LOG_SYMBOL](LogType.group, args);
|
|
229
253
|
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @param {...any} args args
|
|
257
|
+
*/
|
|
230
258
|
}, {
|
|
231
259
|
key: "groupCollapsed",
|
|
232
260
|
value: function groupCollapsed() {
|
|
@@ -238,27 +266,41 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
238
266
|
}, {
|
|
239
267
|
key: "groupEnd",
|
|
240
268
|
value: function groupEnd() {
|
|
241
|
-
|
|
242
|
-
args[_key10] = arguments[_key10];
|
|
243
|
-
}
|
|
244
|
-
this[LOG_SYMBOL](LogType.groupEnd, args);
|
|
269
|
+
this[LOG_SYMBOL](LogType.groupEnd);
|
|
245
270
|
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @param {string=} label label
|
|
274
|
+
*/
|
|
246
275
|
}, {
|
|
247
276
|
key: "profile",
|
|
248
277
|
value: function profile(label) {
|
|
249
278
|
this[LOG_SYMBOL](LogType.profile, [label]);
|
|
250
279
|
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @param {string=} label label
|
|
283
|
+
*/
|
|
251
284
|
}, {
|
|
252
285
|
key: "profileEnd",
|
|
253
286
|
value: function profileEnd(label) {
|
|
254
287
|
this[LOG_SYMBOL](LogType.profileEnd, [label]);
|
|
255
288
|
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @param {string} label label
|
|
292
|
+
*/
|
|
256
293
|
}, {
|
|
257
294
|
key: "time",
|
|
258
295
|
value: function time(label) {
|
|
296
|
+
/** @type {Map<string | undefined, [number, number]>} */
|
|
259
297
|
this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map();
|
|
260
298
|
this[TIMERS_SYMBOL].set(label, process.hrtime());
|
|
261
299
|
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @param {string=} label label
|
|
303
|
+
*/
|
|
262
304
|
}, {
|
|
263
305
|
key: "timeLog",
|
|
264
306
|
value: function timeLog(label) {
|
|
@@ -269,6 +311,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
269
311
|
var time = process.hrtime(prev);
|
|
270
312
|
this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
|
|
271
313
|
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @param {string=} label label
|
|
317
|
+
*/
|
|
272
318
|
}, {
|
|
273
319
|
key: "timeEnd",
|
|
274
320
|
value: function timeEnd(label) {
|
|
@@ -277,9 +323,14 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
277
323
|
throw new Error("No such label '".concat(label, "' for WebpackLogger.timeEnd()"));
|
|
278
324
|
}
|
|
279
325
|
var time = process.hrtime(prev);
|
|
326
|
+
/** @type {Map<string | undefined, [number, number]>} */
|
|
280
327
|
this[TIMERS_SYMBOL].delete(label);
|
|
281
328
|
this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
|
|
282
329
|
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @param {string=} label label
|
|
333
|
+
*/
|
|
283
334
|
}, {
|
|
284
335
|
key: "timeAggregate",
|
|
285
336
|
value: function timeAggregate(label) {
|
|
@@ -288,7 +339,9 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
288
339
|
throw new Error("No such label '".concat(label, "' for WebpackLogger.timeAggregate()"));
|
|
289
340
|
}
|
|
290
341
|
var time = process.hrtime(prev);
|
|
342
|
+
/** @type {Map<string | undefined, [number, number]>} */
|
|
291
343
|
this[TIMERS_SYMBOL].delete(label);
|
|
344
|
+
/** @type {Map<string | undefined, [number, number]>} */
|
|
292
345
|
this[TIMERS_AGGREGATES_SYMBOL] = this[TIMERS_AGGREGATES_SYMBOL] || new Map();
|
|
293
346
|
var current = this[TIMERS_AGGREGATES_SYMBOL].get(label);
|
|
294
347
|
if (current !== undefined) {
|
|
@@ -302,6 +355,10 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
302
355
|
}
|
|
303
356
|
this[TIMERS_AGGREGATES_SYMBOL].set(label, time);
|
|
304
357
|
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @param {string=} label label
|
|
361
|
+
*/
|
|
305
362
|
}, {
|
|
306
363
|
key: "timeAggregateEnd",
|
|
307
364
|
value: function timeAggregateEnd(label) {
|
|
@@ -313,7 +370,7 @@ var WebpackLogger = /*#__PURE__*/function () {
|
|
|
313
370
|
}
|
|
314
371
|
}]);
|
|
315
372
|
}();
|
|
316
|
-
exports.Logger = WebpackLogger;
|
|
373
|
+
module.exports.Logger = WebpackLogger;
|
|
317
374
|
|
|
318
375
|
/***/ }),
|
|
319
376
|
|
|
@@ -330,30 +387,65 @@ exports.Logger = WebpackLogger;
|
|
|
330
387
|
|
|
331
388
|
|
|
332
389
|
|
|
333
|
-
function
|
|
334
|
-
return
|
|
390
|
+
function _slicedToArray(r, e) {
|
|
391
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
392
|
+
}
|
|
393
|
+
function _nonIterableRest() {
|
|
394
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
395
|
+
}
|
|
396
|
+
function _iterableToArrayLimit(r, l) {
|
|
397
|
+
var t = null == r ? null : "undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || r["@@iterator"];
|
|
398
|
+
if (null != t) {
|
|
399
|
+
var e,
|
|
400
|
+
n,
|
|
401
|
+
i,
|
|
402
|
+
u,
|
|
403
|
+
a = [],
|
|
404
|
+
f = !0,
|
|
405
|
+
o = !1;
|
|
406
|
+
try {
|
|
407
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
408
|
+
if (Object(t) !== t) return;
|
|
409
|
+
f = !1;
|
|
410
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
411
|
+
} catch (r) {
|
|
412
|
+
o = !0, n = r;
|
|
413
|
+
} finally {
|
|
414
|
+
try {
|
|
415
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
416
|
+
} finally {
|
|
417
|
+
if (o) throw n;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return a;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function _arrayWithHoles(r) {
|
|
424
|
+
if (Array.isArray(r)) return r;
|
|
425
|
+
}
|
|
426
|
+
function _toConsumableArray(r) {
|
|
427
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
335
428
|
}
|
|
336
429
|
function _nonIterableSpread() {
|
|
337
430
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
338
431
|
}
|
|
339
|
-
function _unsupportedIterableToArray(
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
432
|
+
function _unsupportedIterableToArray(r, a) {
|
|
433
|
+
if (r) {
|
|
434
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
435
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
436
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
437
|
+
}
|
|
346
438
|
}
|
|
347
|
-
function _iterableToArray(
|
|
348
|
-
if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })
|
|
439
|
+
function _iterableToArray(r) {
|
|
440
|
+
if ("undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && null != r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
349
441
|
}
|
|
350
|
-
function _arrayWithoutHoles(
|
|
351
|
-
if (Array.isArray(
|
|
442
|
+
function _arrayWithoutHoles(r) {
|
|
443
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
352
444
|
}
|
|
353
|
-
function _arrayLikeToArray(
|
|
354
|
-
|
|
355
|
-
for (var
|
|
356
|
-
return
|
|
445
|
+
function _arrayLikeToArray(r, a) {
|
|
446
|
+
(null == a || a > r.length) && (a = r.length);
|
|
447
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
448
|
+
return n;
|
|
357
449
|
}
|
|
358
450
|
var _require = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/logging/Logger.js"),
|
|
359
451
|
LogType = _require.LogType;
|
|
@@ -363,9 +455,10 @@ var _require = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/l
|
|
|
363
455
|
/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */
|
|
364
456
|
|
|
365
457
|
/** @typedef {function(string): boolean} FilterFunction */
|
|
458
|
+
/** @typedef {function(string, LogTypeEnum, any[]=): void} LoggingFunction */
|
|
366
459
|
|
|
367
460
|
/**
|
|
368
|
-
* @typedef {
|
|
461
|
+
* @typedef {object} LoggerConsole
|
|
369
462
|
* @property {function(): void} clear
|
|
370
463
|
* @property {function(): void} trace
|
|
371
464
|
* @property {(...args: any[]) => void} info
|
|
@@ -383,7 +476,7 @@ var _require = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/l
|
|
|
383
476
|
*/
|
|
384
477
|
|
|
385
478
|
/**
|
|
386
|
-
* @typedef {
|
|
479
|
+
* @typedef {object} LoggerOptions
|
|
387
480
|
* @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel
|
|
388
481
|
* @property {FilterTypes|boolean} debug filter for debug logging
|
|
389
482
|
* @property {LoggerConsole} console the console to log to
|
|
@@ -391,7 +484,7 @@ var _require = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/l
|
|
|
391
484
|
|
|
392
485
|
/**
|
|
393
486
|
* @param {FilterItemTypes} item an input item
|
|
394
|
-
* @returns {FilterFunction} filter function
|
|
487
|
+
* @returns {FilterFunction | undefined} filter function
|
|
395
488
|
*/
|
|
396
489
|
var filterToFunction = function filterToFunction(item) {
|
|
397
490
|
if (typeof item === "string") {
|
|
@@ -431,7 +524,7 @@ var LogLevel = {
|
|
|
431
524
|
|
|
432
525
|
/**
|
|
433
526
|
* @param {LoggerOptions} options options object
|
|
434
|
-
* @returns {
|
|
527
|
+
* @returns {LoggingFunction} logging function
|
|
435
528
|
*/
|
|
436
529
|
module.exports = function (_ref) {
|
|
437
530
|
var _ref$level = _ref.level,
|
|
@@ -439,7 +532,9 @@ module.exports = function (_ref) {
|
|
|
439
532
|
_ref$debug = _ref.debug,
|
|
440
533
|
debug = _ref$debug === void 0 ? false : _ref$debug,
|
|
441
534
|
console = _ref.console;
|
|
442
|
-
var debugFilters =
|
|
535
|
+
var debugFilters = /** @type {FilterFunction[]} */
|
|
536
|
+
|
|
537
|
+
typeof debug === "boolean" ? [function () {
|
|
443
538
|
return debug;
|
|
444
539
|
}] : /** @type {FilterItemTypes[]} */[].concat(debug).map(filterToFunction);
|
|
445
540
|
/** @type {number} */
|
|
@@ -448,7 +543,7 @@ module.exports = function (_ref) {
|
|
|
448
543
|
/**
|
|
449
544
|
* @param {string} name name of the logger
|
|
450
545
|
* @param {LogTypeEnum} type type of the log entry
|
|
451
|
-
* @param {any[]} args arguments of the log entry
|
|
546
|
+
* @param {any[]=} args arguments of the log entry
|
|
452
547
|
* @returns {void}
|
|
453
548
|
*/
|
|
454
549
|
var logger = function logger(name, type, args) {
|
|
@@ -456,12 +551,10 @@ module.exports = function (_ref) {
|
|
|
456
551
|
if (Array.isArray(args)) {
|
|
457
552
|
if (args.length > 0 && typeof args[0] === "string") {
|
|
458
553
|
return ["[".concat(name, "] ").concat(args[0])].concat(_toConsumableArray(args.slice(1)));
|
|
459
|
-
} else {
|
|
460
|
-
return ["[".concat(name, "]")].concat(_toConsumableArray(args));
|
|
461
554
|
}
|
|
462
|
-
|
|
463
|
-
return [];
|
|
555
|
+
return ["[".concat(name, "]")].concat(_toConsumableArray(args));
|
|
464
556
|
}
|
|
557
|
+
return [];
|
|
465
558
|
};
|
|
466
559
|
var debug = debugFilters.some(function (f) {
|
|
467
560
|
return f(name);
|
|
@@ -523,8 +616,13 @@ module.exports = function (_ref) {
|
|
|
523
616
|
case LogType.time:
|
|
524
617
|
{
|
|
525
618
|
if (!debug && loglevel > LogLevel.log) return;
|
|
526
|
-
var
|
|
527
|
-
|
|
619
|
+
var _args = _slicedToArray(/** @type {[string, number, number]} */
|
|
620
|
+
args, 3),
|
|
621
|
+
label = _args[0],
|
|
622
|
+
start = _args[1],
|
|
623
|
+
end = _args[2];
|
|
624
|
+
var ms = start * 1000 + end / 1000000;
|
|
625
|
+
var msg = "[".concat(name, "] ").concat(label, ": ").concat(ms, " ms");
|
|
528
626
|
if (typeof console.logTime === "function") {
|
|
529
627
|
console.logTime(msg);
|
|
530
628
|
} else {
|
|
@@ -551,15 +649,13 @@ module.exports = function (_ref) {
|
|
|
551
649
|
case LogType.status:
|
|
552
650
|
if (!debug && loglevel > LogLevel.info) return;
|
|
553
651
|
if (typeof console.status === "function") {
|
|
554
|
-
if (args.length === 0) {
|
|
652
|
+
if (!args || args.length === 0) {
|
|
555
653
|
console.status();
|
|
556
654
|
} else {
|
|
557
655
|
console.status.apply(console, _toConsumableArray(labeledArgs()));
|
|
558
656
|
}
|
|
559
|
-
} else {
|
|
560
|
-
|
|
561
|
-
console.info.apply(console, _toConsumableArray(labeledArgs()));
|
|
562
|
-
}
|
|
657
|
+
} else if (args && args.length !== 0) {
|
|
658
|
+
console.info.apply(console, _toConsumableArray(labeledArgs()));
|
|
563
659
|
}
|
|
564
660
|
break;
|
|
565
661
|
default:
|
|
@@ -575,7 +671,7 @@ module.exports = function (_ref) {
|
|
|
575
671
|
/*!*****************************************************!*\
|
|
576
672
|
!*** ./node_modules/webpack/lib/logging/runtime.js ***!
|
|
577
673
|
\*****************************************************/
|
|
578
|
-
/***/ (function(
|
|
674
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
579
675
|
|
|
580
676
|
/*
|
|
581
677
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
@@ -585,18 +681,13 @@ module.exports = function (_ref) {
|
|
|
585
681
|
|
|
586
682
|
|
|
587
683
|
function _extends() {
|
|
588
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
589
|
-
for (var
|
|
590
|
-
var
|
|
591
|
-
for (var
|
|
592
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
593
|
-
target[key] = source[key];
|
|
594
|
-
}
|
|
595
|
-
}
|
|
684
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
685
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
686
|
+
var t = arguments[e];
|
|
687
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
596
688
|
}
|
|
597
|
-
return
|
|
598
|
-
};
|
|
599
|
-
return _extends.apply(this, arguments);
|
|
689
|
+
return n;
|
|
690
|
+
}, _extends.apply(null, arguments);
|
|
600
691
|
}
|
|
601
692
|
var _require = __webpack_require__(/*! tapable */ "./client-src/modules/logger/tapable.js"),
|
|
602
693
|
SyncBailHook = _require.SyncBailHook;
|
|
@@ -616,13 +707,13 @@ var currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
|
|
|
616
707
|
* @param {string} name name of the logger
|
|
617
708
|
* @returns {Logger} a logger
|
|
618
709
|
*/
|
|
619
|
-
exports.getLogger = function (name) {
|
|
710
|
+
module.exports.getLogger = function (name) {
|
|
620
711
|
return new Logger(function (type, args) {
|
|
621
|
-
if (exports.hooks.log.call(name, type, args) === undefined) {
|
|
712
|
+
if (module.exports.hooks.log.call(name, type, args) === undefined) {
|
|
622
713
|
currentDefaultLogger(name, type, args);
|
|
623
714
|
}
|
|
624
715
|
}, function (childName) {
|
|
625
|
-
return exports.getLogger("".concat(name, "/").concat(childName));
|
|
716
|
+
return module.exports.getLogger("".concat(name, "/").concat(childName));
|
|
626
717
|
});
|
|
627
718
|
};
|
|
628
719
|
|
|
@@ -630,11 +721,11 @@ exports.getLogger = function (name) {
|
|
|
630
721
|
* @param {createConsoleLogger.LoggerOptions} options new options, merge with old options
|
|
631
722
|
* @returns {void}
|
|
632
723
|
*/
|
|
633
|
-
exports.configureDefaultLogger = function (options) {
|
|
724
|
+
module.exports.configureDefaultLogger = function (options) {
|
|
634
725
|
_extends(currentDefaultLoggerOptions, options);
|
|
635
726
|
currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
|
|
636
727
|
};
|
|
637
|
-
exports.hooks = {
|
|
728
|
+
module.exports.hooks = {
|
|
638
729
|
log: new SyncBailHook(["origin", "type", "args"])
|
|
639
730
|
};
|
|
640
731
|
|
|
@@ -697,8 +788,6 @@ exports.hooks = {
|
|
|
697
788
|
/******/
|
|
698
789
|
/************************************************************************/
|
|
699
790
|
var __webpack_exports__ = {};
|
|
700
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
701
|
-
!function() {
|
|
702
791
|
/*!********************************************!*\
|
|
703
792
|
!*** ./client-src/modules/logger/index.js ***!
|
|
704
793
|
\********************************************/
|
|
@@ -708,7 +797,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
708
797
|
/* harmony export */ });
|
|
709
798
|
/* harmony import */ var webpack_lib_logging_runtime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack/lib/logging/runtime.js */ "./node_modules/webpack/lib/logging/runtime.js");
|
|
710
799
|
|
|
711
|
-
}();
|
|
712
800
|
var __webpack_export_target__ = exports;
|
|
713
801
|
for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
|
|
714
802
|
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
@@ -3133,7 +3133,7 @@ module.exports = XHRCorsObject;
|
|
|
3133
3133
|
|
|
3134
3134
|
var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|
3135
3135
|
inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");
|
|
3136
|
-
function XHRFake(
|
|
3136
|
+
function XHRFake(/* method, url, payload, opts */
|
|
3137
3137
|
) {
|
|
3138
3138
|
var self = this;
|
|
3139
3139
|
EventEmitter.call(this);
|
package/client/overlay/fsm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
-
function _defineProperty(
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
/**
|
package/client/overlay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
-
function _defineProperty(
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
|
|
@@ -107,10 +107,10 @@ var createOverlay = function createOverlay(options) {
|
|
|
107
107
|
applyStyle(iframeContainerElement, iframeStyle);
|
|
108
108
|
iframeContainerElement.onload = function () {
|
|
109
109
|
var contentElement = /** @type {Document} */
|
|
110
|
-
(
|
|
110
|
+
(/** @type {HTMLIFrameElement} */
|
|
111
111
|
iframeContainerElement.contentDocument).createElement("div");
|
|
112
112
|
containerElement = /** @type {Document} */
|
|
113
|
-
(
|
|
113
|
+
(/** @type {HTMLIFrameElement} */
|
|
114
114
|
iframeContainerElement.contentDocument).createElement("div");
|
|
115
115
|
contentElement.id = "webpack-dev-server-client-overlay-div";
|
|
116
116
|
applyStyle(contentElement, containerStyle);
|
|
@@ -132,10 +132,10 @@ var createOverlay = function createOverlay(options) {
|
|
|
132
132
|
contentElement.appendChild(containerElement);
|
|
133
133
|
|
|
134
134
|
/** @type {Document} */
|
|
135
|
-
(
|
|
135
|
+
(/** @type {HTMLIFrameElement} */
|
|
136
136
|
iframeContainerElement.contentDocument).body.appendChild(contentElement);
|
|
137
137
|
onLoadQueue.forEach(function (onLoad) {
|
|
138
|
-
onLoad(
|
|
138
|
+
onLoad(/** @type {HTMLDivElement} */contentElement);
|
|
139
139
|
});
|
|
140
140
|
onLoadQueue = [];
|
|
141
141
|
|