@rspack/dev-server 1.1.5 → 1.2.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.
@@ -0,0 +1,725 @@
1
+ (function() {
2
+ "use strict";
3
+ var __webpack_modules__ = ({
4
+ "./modules/logger/Logger.ts": (function (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
5
+ __webpack_require__.r(__webpack_exports__);
6
+ __webpack_require__.d(__webpack_exports__, {
7
+ Logger: function() { return WebpackLogger; }
8
+ });
9
+ /* import */ var _types__rspack_import_0 = __webpack_require__("./modules/types.ts");
10
+ function _instanceof(left, right) {
11
+ if (right != null && typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && right[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).hasInstance]) {
12
+ return !!right[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).hasInstance](left);
13
+ } else {
14
+ return left instanceof right;
15
+ }
16
+ }
17
+ function _array_like_to_array(arr, len) {
18
+ if (len == null || len > arr.length) len = arr.length;
19
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
20
+ return arr2;
21
+ }
22
+ function _array_without_holes(arr) {
23
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
24
+ }
25
+ function _class_call_check(instance, Constructor) {
26
+ if (!_instanceof(instance, Constructor)) {
27
+ throw new TypeError("Cannot call a class as a function");
28
+ }
29
+ }
30
+ function _defineProperties(target, props) {
31
+ for(var i = 0; i < props.length; i++){
32
+ var descriptor = props[i];
33
+ descriptor.enumerable = descriptor.enumerable || false;
34
+ descriptor.configurable = true;
35
+ if ("value" in descriptor) descriptor.writable = true;
36
+ Object.defineProperty(target, descriptor.key, descriptor);
37
+ }
38
+ }
39
+ function _create_class(Constructor, protoProps, staticProps) {
40
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
41
+ if (staticProps) _defineProperties(Constructor, staticProps);
42
+ return Constructor;
43
+ }
44
+ function _define_property(obj, key, value) {
45
+ if (key in obj) {
46
+ Object.defineProperty(obj, key, {
47
+ value: value,
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true
51
+ });
52
+ } else {
53
+ obj[key] = value;
54
+ }
55
+ return obj;
56
+ }
57
+ function _iterable_to_array(iter) {
58
+ if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
59
+ }
60
+ function _non_iterable_spread() {
61
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
62
+ }
63
+ function _to_consumable_array(arr) {
64
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
65
+ }
66
+ function _unsupported_iterable_to_array(o, minLen) {
67
+ if (!o) return;
68
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
69
+ var n = Object.prototype.toString.call(o).slice(8, -1);
70
+ if (n === "Object" && o.constructor) n = o.constructor.name;
71
+ if (n === "Map" || n === "Set") return Array.from(n);
72
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
73
+ }
74
+ /**
75
+ * The following code is modified based on
76
+ * https://github.com/webpack/webpack-dev-server
77
+ *
78
+ * MIT Licensed
79
+ * Author Tobias Koppers @sokra
80
+ * Copyright (c) JS Foundation and other contributors
81
+ * https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
82
+ */
83
+ var LOG_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })('webpack logger raw log method');
84
+ var TIMERS_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })('webpack logger times');
85
+ var TIMERS_AGGREGATES_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })('webpack logger aggregated times');
86
+ var _LOG_SYMBOL = LOG_SYMBOL, _TIMERS_SYMBOL = TIMERS_SYMBOL, _TIMERS_AGGREGATES_SYMBOL = TIMERS_AGGREGATES_SYMBOL;
87
+ var WebpackLogger = /*#__PURE__*/ function() {
88
+ "use strict";
89
+ function WebpackLogger(log, getChildLogger) {
90
+ _class_call_check(this, WebpackLogger);
91
+ _define_property(this, _LOG_SYMBOL, void 0);
92
+ _define_property(this, _TIMERS_SYMBOL, new Map());
93
+ _define_property(this, _TIMERS_AGGREGATES_SYMBOL, new Map());
94
+ // @ts-ignore
95
+ _define_property(this, "getChildLogger", void 0);
96
+ this[LOG_SYMBOL] = log;
97
+ this.getChildLogger = getChildLogger;
98
+ }
99
+ _create_class(WebpackLogger, [
100
+ {
101
+ key: "error",
102
+ value: function error() {
103
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
104
+ args[_key] = arguments[_key];
105
+ }
106
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.error, args);
107
+ }
108
+ },
109
+ {
110
+ key: "warn",
111
+ value: function warn() {
112
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
113
+ args[_key] = arguments[_key];
114
+ }
115
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.warn, args);
116
+ }
117
+ },
118
+ {
119
+ key: "info",
120
+ value: function info() {
121
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
122
+ args[_key] = arguments[_key];
123
+ }
124
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.info, args);
125
+ }
126
+ },
127
+ {
128
+ key: "log",
129
+ value: function log() {
130
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
131
+ args[_key] = arguments[_key];
132
+ }
133
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.log, args);
134
+ }
135
+ },
136
+ {
137
+ key: "debug",
138
+ value: function debug() {
139
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
140
+ args[_key] = arguments[_key];
141
+ }
142
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.debug, args);
143
+ }
144
+ },
145
+ {
146
+ key: "assert",
147
+ value: function assert(assertion) {
148
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
149
+ args[_key - 1] = arguments[_key];
150
+ }
151
+ if (!assertion) {
152
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.error, args);
153
+ }
154
+ }
155
+ },
156
+ {
157
+ key: "trace",
158
+ value: function trace() {
159
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.trace, [
160
+ 'Trace'
161
+ ]);
162
+ }
163
+ },
164
+ {
165
+ key: "clear",
166
+ value: function clear() {
167
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.clear);
168
+ }
169
+ },
170
+ {
171
+ key: "status",
172
+ value: function status() {
173
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
174
+ args[_key] = arguments[_key];
175
+ }
176
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.status, args);
177
+ }
178
+ },
179
+ {
180
+ key: "group",
181
+ value: function group() {
182
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
183
+ args[_key] = arguments[_key];
184
+ }
185
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.group, args);
186
+ }
187
+ },
188
+ {
189
+ key: "groupCollapsed",
190
+ value: function groupCollapsed() {
191
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
192
+ args[_key] = arguments[_key];
193
+ }
194
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.groupCollapsed, args);
195
+ }
196
+ },
197
+ {
198
+ key: "groupEnd",
199
+ value: function groupEnd() {
200
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.groupEnd);
201
+ }
202
+ },
203
+ {
204
+ key: "profile",
205
+ value: function profile(label) {
206
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.profile, [
207
+ label
208
+ ]);
209
+ }
210
+ },
211
+ {
212
+ key: "profileEnd",
213
+ value: function profileEnd(label) {
214
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.profileEnd, [
215
+ label
216
+ ]);
217
+ }
218
+ },
219
+ {
220
+ key: "time",
221
+ value: function time(label) {
222
+ this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map();
223
+ this[TIMERS_SYMBOL].set(label, process.hrtime());
224
+ }
225
+ },
226
+ {
227
+ key: "timeLog",
228
+ value: function timeLog(label) {
229
+ var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
230
+ if (!prev) {
231
+ throw new Error("No such label '".concat(label, "' for WebpackLogger.timeLog()"));
232
+ }
233
+ var time = process.hrtime(prev);
234
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.time, [
235
+ label
236
+ ].concat(_to_consumable_array(time)));
237
+ }
238
+ },
239
+ {
240
+ key: "timeEnd",
241
+ value: function timeEnd(label) {
242
+ var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
243
+ if (!prev) {
244
+ throw new Error("No such label '".concat(label, "' for WebpackLogger.timeEnd()"));
245
+ }
246
+ var time = process.hrtime(prev);
247
+ /** @type {TimersMap} */ this[TIMERS_SYMBOL].delete(label);
248
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.time, [
249
+ label
250
+ ].concat(_to_consumable_array(time)));
251
+ }
252
+ },
253
+ {
254
+ key: "timeAggregate",
255
+ value: function timeAggregate(label) {
256
+ var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
257
+ if (!prev) {
258
+ throw new Error("No such label '".concat(label, "' for WebpackLogger.timeAggregate()"));
259
+ }
260
+ var time = process.hrtime(prev);
261
+ this[TIMERS_SYMBOL].delete(label);
262
+ this[TIMERS_AGGREGATES_SYMBOL] = this[TIMERS_AGGREGATES_SYMBOL] || new Map();
263
+ var current = this[TIMERS_AGGREGATES_SYMBOL].get(label);
264
+ if (current !== undefined) {
265
+ if (time[1] + current[1] > 1e9) {
266
+ time[0] += current[0] + 1;
267
+ time[1] = time[1] - 1e9 + current[1];
268
+ } else {
269
+ time[0] += current[0];
270
+ time[1] += current[1];
271
+ }
272
+ }
273
+ this[TIMERS_AGGREGATES_SYMBOL].set(label, time);
274
+ }
275
+ },
276
+ {
277
+ key: "timeAggregateEnd",
278
+ value: function timeAggregateEnd(label) {
279
+ if (this[TIMERS_AGGREGATES_SYMBOL] === undefined) return;
280
+ var time = this[TIMERS_AGGREGATES_SYMBOL].get(label);
281
+ if (time === undefined) return;
282
+ this[TIMERS_AGGREGATES_SYMBOL].delete(label);
283
+ this[LOG_SYMBOL](_types__rspack_import_0.LogType.time, [
284
+ label
285
+ ].concat(_to_consumable_array(time)));
286
+ }
287
+ }
288
+ ]);
289
+ return WebpackLogger;
290
+ }();
291
+
292
+
293
+
294
+ }),
295
+ "./modules/logger/createConsoleLogger.ts": (function (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
296
+ __webpack_require__.r(__webpack_exports__);
297
+ __webpack_require__.d(__webpack_exports__, {
298
+ "default": function() { return /* export default binding */ __rspack_default_export; }
299
+ });
300
+ /* import */ var _types__rspack_import_0 = __webpack_require__("./modules/types.ts");
301
+ function _array_like_to_array(arr, len) {
302
+ if (len == null || len > arr.length) len = arr.length;
303
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
304
+ return arr2;
305
+ }
306
+ function _array_with_holes(arr) {
307
+ if (Array.isArray(arr)) return arr;
308
+ }
309
+ function _array_without_holes(arr) {
310
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
311
+ }
312
+ function _iterable_to_array(iter) {
313
+ if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
314
+ }
315
+ function _iterable_to_array_limit(arr, i) {
316
+ var _i = arr == null ? null : typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && arr[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || arr["@@iterator"];
317
+ if (_i == null) return;
318
+ var _arr = [];
319
+ var _n = true;
320
+ var _d = false;
321
+ var _s, _e;
322
+ try {
323
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
324
+ _arr.push(_s.value);
325
+ if (i && _arr.length === i) break;
326
+ }
327
+ } catch (err) {
328
+ _d = true;
329
+ _e = err;
330
+ } finally{
331
+ try {
332
+ if (!_n && _i["return"] != null) _i["return"]();
333
+ } finally{
334
+ if (_d) throw _e;
335
+ }
336
+ }
337
+ return _arr;
338
+ }
339
+ function _non_iterable_rest() {
340
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
341
+ }
342
+ function _non_iterable_spread() {
343
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
344
+ }
345
+ function _sliced_to_array(arr, i) {
346
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
347
+ }
348
+ function _to_consumable_array(arr) {
349
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
350
+ }
351
+ function _type_of(obj) {
352
+ "@swc/helpers - typeof";
353
+ return obj && typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && obj.constructor === (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) ? "symbol" : typeof obj;
354
+ }
355
+ function _unsupported_iterable_to_array(o, minLen) {
356
+ if (!o) return;
357
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
358
+ var n = Object.prototype.toString.call(o).slice(8, -1);
359
+ if (n === "Object" && o.constructor) n = o.constructor.name;
360
+ if (n === "Map" || n === "Set") return Array.from(n);
361
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
362
+ }
363
+ /**
364
+ * The following code is modified based on
365
+ * https://github.com/webpack/webpack-dev-server
366
+ *
367
+ * MIT Licensed
368
+ * Author Tobias Koppers @sokra
369
+ * Copyright (c) JS Foundation and other contributors
370
+ * https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
371
+ */
372
+ var filterToFunction = function filterToFunction(item) {
373
+ if (typeof item === 'string') {
374
+ var regExp = new RegExp("[\\\\/]".concat(item.replace(/[-[\]{}()*+?.\\^$|]/g, '\\$&'), "([\\\\/]|$|!|\\?)"));
375
+ return function(ident) {
376
+ return regExp.test(ident);
377
+ };
378
+ }
379
+ if (item && (typeof item === "undefined" ? "undefined" : _type_of(item)) === 'object' && typeof item.test === 'function') {
380
+ return function(ident) {
381
+ return item.test(ident);
382
+ };
383
+ }
384
+ if (typeof item === 'function') {
385
+ return item;
386
+ }
387
+ if (typeof item === 'boolean') {
388
+ return function() {
389
+ return item;
390
+ };
391
+ }
392
+ };
393
+ var LogLevel = {
394
+ none: 6,
395
+ false: 6,
396
+ error: 5,
397
+ warn: 4,
398
+ info: 3,
399
+ log: 2,
400
+ true: 2,
401
+ verbose: 1
402
+ };
403
+ /* export default */ function __rspack_default_export(param) {
404
+ var _param_level = param.level, level = _param_level === void 0 ? 'info' : _param_level, _param_debug = param.debug, debug = _param_debug === void 0 ? false : _param_debug, console = param.console;
405
+ var debugFilters = typeof debug === 'boolean' ? [
406
+ function() {
407
+ return debug;
408
+ }
409
+ ] : _to_consumable_array(Array.isArray(debug) ? debug : [
410
+ debug
411
+ ]).map(filterToFunction);
412
+ var loglevel = LogLevel["".concat(level)] || 0;
413
+ var logger = function logger(name, type, args) {
414
+ var labeledArgs = function labeledArgs() {
415
+ if (Array.isArray(args)) {
416
+ if (args.length > 0 && typeof args[0] === 'string') {
417
+ return [
418
+ "[".concat(name, "] ").concat(args[0])
419
+ ].concat(_to_consumable_array(args.slice(1)));
420
+ }
421
+ return [
422
+ "[".concat(name, "]")
423
+ ].concat(_to_consumable_array(args));
424
+ }
425
+ return [];
426
+ };
427
+ var debug = debugFilters.some(function(f) {
428
+ return f(name);
429
+ });
430
+ switch(type){
431
+ case _types__rspack_import_0.LogType.debug:
432
+ if (!debug) return;
433
+ if (typeof console.debug === 'function') {
434
+ var _console;
435
+ (_console = console).debug.apply(_console, _to_consumable_array(labeledArgs()));
436
+ } else {
437
+ var _console1;
438
+ (_console1 = console).log.apply(_console1, _to_consumable_array(labeledArgs()));
439
+ }
440
+ break;
441
+ case _types__rspack_import_0.LogType.log:
442
+ var _console2;
443
+ if (!debug && loglevel > LogLevel.log) return;
444
+ (_console2 = console).log.apply(_console2, _to_consumable_array(labeledArgs()));
445
+ break;
446
+ case _types__rspack_import_0.LogType.info:
447
+ var _console3;
448
+ if (!debug && loglevel > LogLevel.info) return;
449
+ (_console3 = console).info.apply(_console3, _to_consumable_array(labeledArgs()));
450
+ break;
451
+ case _types__rspack_import_0.LogType.warn:
452
+ var _console4;
453
+ if (!debug && loglevel > LogLevel.warn) return;
454
+ (_console4 = console).warn.apply(_console4, _to_consumable_array(labeledArgs()));
455
+ break;
456
+ case _types__rspack_import_0.LogType.error:
457
+ var _console5;
458
+ if (!debug && loglevel > LogLevel.error) return;
459
+ (_console5 = console).error.apply(_console5, _to_consumable_array(labeledArgs()));
460
+ break;
461
+ case _types__rspack_import_0.LogType.trace:
462
+ if (!debug) return;
463
+ console.trace();
464
+ break;
465
+ case _types__rspack_import_0.LogType.groupCollapsed:
466
+ if (!debug && loglevel > LogLevel.log) return;
467
+ if (!debug && loglevel > LogLevel.verbose) {
468
+ if (typeof console.groupCollapsed === 'function') {
469
+ var _console6;
470
+ (_console6 = console).groupCollapsed.apply(_console6, _to_consumable_array(labeledArgs()));
471
+ } else {
472
+ var _console7;
473
+ (_console7 = console).log.apply(_console7, _to_consumable_array(labeledArgs()));
474
+ }
475
+ break;
476
+ }
477
+ // falls through
478
+ case _types__rspack_import_0.LogType.group:
479
+ if (!debug && loglevel > LogLevel.log) return;
480
+ if (typeof console.group === 'function') {
481
+ var _console8;
482
+ (_console8 = console).group.apply(_console8, _to_consumable_array(labeledArgs()));
483
+ } else {
484
+ var _console9;
485
+ (_console9 = console).log.apply(_console9, _to_consumable_array(labeledArgs()));
486
+ }
487
+ break;
488
+ case _types__rspack_import_0.LogType.groupEnd:
489
+ if (!debug && loglevel > LogLevel.log) return;
490
+ if (typeof console.groupEnd === 'function') {
491
+ console.groupEnd();
492
+ }
493
+ break;
494
+ case _types__rspack_import_0.LogType.time:
495
+ {
496
+ if (!debug && loglevel > LogLevel.log) return;
497
+ var _args = _sliced_to_array(args, 3), label = _args[0], start = _args[1], end = _args[2];
498
+ var ms = start * 1000 + end / 1000000;
499
+ var msg = "[".concat(name, "] ").concat(label, ": ").concat(ms, " ms");
500
+ if (typeof console.logTime === 'function') {
501
+ console.logTime(msg);
502
+ } else {
503
+ console.log(msg);
504
+ }
505
+ break;
506
+ }
507
+ case _types__rspack_import_0.LogType.profile:
508
+ if (typeof console.profile === 'function') {
509
+ var _console10;
510
+ (_console10 = console).profile.apply(_console10, _to_consumable_array(labeledArgs()));
511
+ }
512
+ break;
513
+ case _types__rspack_import_0.LogType.profileEnd:
514
+ if (typeof console.profileEnd === 'function') {
515
+ var _console11;
516
+ (_console11 = console).profileEnd.apply(_console11, _to_consumable_array(labeledArgs()));
517
+ }
518
+ break;
519
+ case _types__rspack_import_0.LogType.clear:
520
+ if (!debug && loglevel > LogLevel.log) return;
521
+ if (typeof console.clear === 'function') {
522
+ console.clear();
523
+ }
524
+ break;
525
+ case _types__rspack_import_0.LogType.status:
526
+ if (!debug && loglevel > LogLevel.info) return;
527
+ if (typeof console.status === 'function') {
528
+ if (!args || args.length === 0) {
529
+ console.status();
530
+ } else {
531
+ var _console12;
532
+ (_console12 = console).status.apply(_console12, _to_consumable_array(labeledArgs()));
533
+ }
534
+ } else if (args && args.length !== 0) {
535
+ var _console13;
536
+ (_console13 = console).info.apply(_console13, _to_consumable_array(labeledArgs()));
537
+ }
538
+ break;
539
+ default:
540
+ throw new Error("Unexpected LogType ".concat(type));
541
+ }
542
+ };
543
+ return logger;
544
+ }
545
+
546
+
547
+ }),
548
+ "./modules/logger/runtime.ts": (function (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
549
+ __webpack_require__.r(__webpack_exports__);
550
+ __webpack_require__.d(__webpack_exports__, {
551
+ configureDefaultLogger: function() { return configureDefaultLogger; },
552
+ getLogger: function() { return getLogger; },
553
+ hooks: function() { return hooks; }
554
+ });
555
+ /* import */ var _tapable__rspack_import_0 = __webpack_require__("./modules/logger/tapable.ts");
556
+ /* import */ var _Logger__rspack_import_1 = __webpack_require__("./modules/logger/Logger.ts");
557
+ /* import */ var _createConsoleLogger__rspack_import_2 = __webpack_require__("./modules/logger/createConsoleLogger.ts");
558
+ /**
559
+ * The following code is modified based on
560
+ * https://github.com/webpack/webpack-dev-server
561
+ *
562
+ * MIT Licensed
563
+ * Author Tobias Koppers @sokra
564
+ * Copyright (c) JS Foundation and other contributors
565
+ * https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
566
+ */
567
+
568
+
569
+ var currentDefaultLoggerOptions = {
570
+ level: 'info',
571
+ debug: false,
572
+ console: console
573
+ };
574
+ var currentDefaultLogger = (0,_createConsoleLogger__rspack_import_2["default"])(currentDefaultLoggerOptions);
575
+ var configureDefaultLogger = function configureDefaultLogger(options) {
576
+ Object.assign(currentDefaultLoggerOptions, options);
577
+ currentDefaultLogger = (0,_createConsoleLogger__rspack_import_2["default"])(currentDefaultLoggerOptions);
578
+ };
579
+ var getLogger = function getLogger1(name) {
580
+ return new _Logger__rspack_import_1.Logger(function(type, args) {
581
+ if (hooks.log.call(name, type, args) === undefined) {
582
+ currentDefaultLogger(name, type, args);
583
+ }
584
+ }, function(childName) {
585
+ return getLogger("".concat(name, "/").concat(childName));
586
+ });
587
+ };
588
+ var hooks = {
589
+ // @ts-ignore
590
+ log: new _tapable__rspack_import_0.SyncBailHook([
591
+ 'origin',
592
+ 'type',
593
+ 'args'
594
+ ])
595
+ };
596
+
597
+ /* export default */ __webpack_exports__["default"] = ({
598
+ getLogger: getLogger,
599
+ configureDefaultLogger: configureDefaultLogger,
600
+ hooks: hooks
601
+ });
602
+
603
+
604
+ }),
605
+ "./modules/logger/tapable.ts": (function (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
606
+ __webpack_require__.r(__webpack_exports__);
607
+ __webpack_require__.d(__webpack_exports__, {
608
+ SyncBailHook: function() { return SyncBailHook; }
609
+ });
610
+ /**
611
+ * The following code is modified based on
612
+ * https://github.com/webpack/webpack-dev-server
613
+ *
614
+ * MIT Licensed
615
+ * Author Tobias Koppers @sokra
616
+ * Copyright (c) JS Foundation and other contributors
617
+ * https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
618
+ */ function SyncBailHook() {
619
+ return {
620
+ call: function call() {}
621
+ };
622
+ }
623
+ /**
624
+ * Client stub for tapable SyncBailHook
625
+ */
626
+
627
+
628
+ }),
629
+ "./modules/types.ts": (function (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
630
+ __webpack_require__.r(__webpack_exports__);
631
+ __webpack_require__.d(__webpack_exports__, {
632
+ LogType: function() { return LogType; }
633
+ });
634
+ var LogType = Object.freeze({
635
+ error: 'error',
636
+ warn: 'warn',
637
+ info: 'info',
638
+ log: 'log',
639
+ debug: 'debug',
640
+ trace: 'trace',
641
+ group: 'group',
642
+ groupCollapsed: 'groupCollapsed',
643
+ groupEnd: 'groupEnd',
644
+ profile: 'profile',
645
+ profileEnd: 'profileEnd',
646
+ time: 'time',
647
+ clear: 'clear',
648
+ status: 'status'
649
+ });
650
+
651
+
652
+ }),
653
+
654
+ });
655
+ // The module cache
656
+ var __webpack_module_cache__ = {};
657
+
658
+ // The require function
659
+ function __webpack_require__(moduleId) {
660
+
661
+ // Check if module is in cache
662
+ var cachedModule = __webpack_module_cache__[moduleId];
663
+ if (cachedModule !== undefined) {
664
+ return cachedModule.exports;
665
+ }
666
+ // Create a new module (and put it into the cache)
667
+ var module = (__webpack_module_cache__[moduleId] = {
668
+ exports: {}
669
+ });
670
+ // Execute the module function
671
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
672
+
673
+ // Return the exports of the module
674
+ return module.exports;
675
+
676
+ }
677
+
678
+ // webpack/runtime/define_property_getters
679
+ !function() {
680
+ __webpack_require__.d = function(exports, definition) {
681
+ for(var key in definition) {
682
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
683
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
684
+ }
685
+ }
686
+ };
687
+ }();
688
+ // webpack/runtime/has_own_property
689
+ !function() {
690
+ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
691
+ }();
692
+ // webpack/runtime/make_namespace_object
693
+ !function() {
694
+ // define __esModule on exports
695
+ __webpack_require__.r = function(exports) {
696
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
697
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
698
+ }
699
+ Object.defineProperty(exports, '__esModule', { value: true });
700
+ };
701
+ }();
702
+ var __webpack_exports__ = {};
703
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
704
+ !function() {
705
+ __webpack_require__.r(__webpack_exports__);
706
+ __webpack_require__.d(__webpack_exports__, {
707
+ "default": function() { return /* reexport safe */ _runtime__rspack_import_0["default"]; }
708
+ });
709
+ /* import */ var _runtime__rspack_import_0 = __webpack_require__("./modules/logger/runtime.ts");
710
+ /**
711
+ * The following code is modified based on
712
+ * https://github.com/webpack/webpack-dev-server
713
+ *
714
+ * MIT Licensed
715
+ * Author Tobias Koppers @sokra
716
+ * Copyright (c) JS Foundation and other contributors
717
+ * https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
718
+ */
719
+
720
+ }();
721
+ var __rspack_exports_target = exports;
722
+ for(var __rspack_i in __webpack_exports__) __rspack_exports_target[__rspack_i] = __webpack_exports__[__rspack_i];
723
+ if(__webpack_exports__.__esModule) Object.defineProperty(__rspack_exports_target, '__esModule', { value: true });
724
+ })()
725
+ ;