@rsbuild/core 1.7.5 → 1.7.6

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.
@@ -1,19 +1,29 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 821: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 252: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const WebSocket = __nccwpck_require__(234);
6
- WebSocket.createWebSocketStream = __nccwpck_require__(297);
7
- WebSocket.Server = __nccwpck_require__(788);
8
- WebSocket.Receiver = __nccwpck_require__(176);
9
- WebSocket.Sender = __nccwpck_require__(480);
5
+ const createWebSocketStream = __nccwpck_require__(614);
6
+ const extension = __nccwpck_require__(165);
7
+ const PerMessageDeflate = __nccwpck_require__(86);
8
+ const Receiver = __nccwpck_require__(479);
9
+ const Sender = __nccwpck_require__(243);
10
+ const subprotocol = __nccwpck_require__(94);
11
+ const WebSocket = __nccwpck_require__(983);
12
+ const WebSocketServer = __nccwpck_require__(624);
13
+ WebSocket.createWebSocketStream = createWebSocketStream;
14
+ WebSocket.extension = extension;
15
+ WebSocket.PerMessageDeflate = PerMessageDeflate;
16
+ WebSocket.Receiver = Receiver;
17
+ WebSocket.Sender = Sender;
18
+ WebSocket.Server = WebSocketServer;
19
+ WebSocket.subprotocol = subprotocol;
10
20
  WebSocket.WebSocket = WebSocket;
11
- WebSocket.WebSocketServer = WebSocket.Server;
21
+ WebSocket.WebSocketServer = WebSocketServer;
12
22
  module.exports = WebSocket;
13
23
  },
14
- 72: (module, __unused_webpack_exports, __nccwpck_require__) => {
24
+ 393: (module, __unused_webpack_exports, __nccwpck_require__) => {
15
25
  "use strict";
16
- const { EMPTY_BUFFER } = __nccwpck_require__(892);
26
+ const { EMPTY_BUFFER } = __nccwpck_require__(149);
17
27
  const FastBuffer = Buffer[Symbol.species];
18
28
  function concat(list, totalLength) {
19
29
  if (list.length === 0) return EMPTY_BUFFER;
@@ -87,13 +97,14 @@
87
97
  } catch (e) {}
88
98
  }
89
99
  },
90
- 892: (module) => {
100
+ 149: (module) => {
91
101
  "use strict";
92
102
  const BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
93
103
  const hasBlob = typeof Blob !== "undefined";
94
104
  if (hasBlob) BINARY_TYPES.push("blob");
95
105
  module.exports = {
96
106
  BINARY_TYPES,
107
+ CLOSE_TIMEOUT: 3e4,
97
108
  EMPTY_BUFFER: Buffer.alloc(0),
98
109
  GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
99
110
  hasBlob,
@@ -104,9 +115,9 @@
104
115
  NOOP: () => {},
105
116
  };
106
117
  },
107
- 95: (module, __unused_webpack_exports, __nccwpck_require__) => {
118
+ 332: (module, __unused_webpack_exports, __nccwpck_require__) => {
108
119
  "use strict";
109
- const { kForOnEventAttribute, kListener } = __nccwpck_require__(892);
120
+ const { kForOnEventAttribute, kListener } = __nccwpck_require__(149);
110
121
  const kCode = Symbol("kCode");
111
122
  const kData = Symbol("kData");
112
123
  const kError = Symbol("kError");
@@ -268,9 +279,9 @@
268
279
  }
269
280
  }
270
281
  },
271
- 468: (module, __unused_webpack_exports, __nccwpck_require__) => {
282
+ 165: (module, __unused_webpack_exports, __nccwpck_require__) => {
272
283
  "use strict";
273
- const { tokenChars } = __nccwpck_require__(342);
284
+ const { tokenChars } = __nccwpck_require__(125);
274
285
  function push(dest, name, elem) {
275
286
  if (dest[name] === undefined) dest[name] = [elem];
276
287
  else dest[name].push(elem);
@@ -426,7 +437,7 @@
426
437
  }
427
438
  module.exports = { format, parse };
428
439
  },
429
- 137: (module) => {
440
+ 456: (module) => {
430
441
  "use strict";
431
442
  const kDone = Symbol("kDone");
432
443
  const kRun = Symbol("kRun");
@@ -455,12 +466,12 @@
455
466
  }
456
467
  module.exports = Limiter;
457
468
  },
458
- 465: (module, __unused_webpack_exports, __nccwpck_require__) => {
469
+ 86: (module, __unused_webpack_exports, __nccwpck_require__) => {
459
470
  "use strict";
460
471
  const zlib = __nccwpck_require__(106);
461
- const bufferUtil = __nccwpck_require__(72);
462
- const Limiter = __nccwpck_require__(137);
463
- const { kStatusCode } = __nccwpck_require__(892);
472
+ const bufferUtil = __nccwpck_require__(393);
473
+ const Limiter = __nccwpck_require__(456);
474
+ const { kStatusCode } = __nccwpck_require__(149);
464
475
  const FastBuffer = Buffer[Symbol.species];
465
476
  const TRAILER = Buffer.from([0, 0, 255, 255]);
466
477
  const kPerMessageDeflate = Symbol("permessage-deflate");
@@ -470,14 +481,14 @@
470
481
  const kError = Symbol("error");
471
482
  let zlibLimiter;
472
483
  class PerMessageDeflate {
473
- constructor(options, isServer, maxPayload) {
474
- this._maxPayload = maxPayload | 0;
484
+ constructor(options) {
475
485
  this._options = options || {};
476
486
  this._threshold =
477
487
  this._options.threshold !== undefined
478
488
  ? this._options.threshold
479
489
  : 1024;
480
- this._isServer = !!isServer;
490
+ this._maxPayload = this._options.maxPayload | 0;
491
+ this._isServer = !!this._options.isServer;
481
492
  this._deflate = null;
482
493
  this._inflate = null;
483
494
  this.params = null;
@@ -784,14 +795,14 @@
784
795
  this[kCallback](err);
785
796
  }
786
797
  },
787
- 176: (module, __unused_webpack_exports, __nccwpck_require__) => {
798
+ 479: (module, __unused_webpack_exports, __nccwpck_require__) => {
788
799
  "use strict";
789
800
  const { Writable } = __nccwpck_require__(203);
790
- const PerMessageDeflate = __nccwpck_require__(465);
801
+ const PerMessageDeflate = __nccwpck_require__(86);
791
802
  const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } =
792
- __nccwpck_require__(892);
793
- const { concat, toArrayBuffer, unmask } = __nccwpck_require__(72);
794
- const { isValidStatusCode, isValidUTF8 } = __nccwpck_require__(342);
803
+ __nccwpck_require__(149);
804
+ const { concat, toArrayBuffer, unmask } = __nccwpck_require__(393);
805
+ const { isValidStatusCode, isValidUTF8 } = __nccwpck_require__(125);
795
806
  const FastBuffer = Buffer[Symbol.species];
796
807
  const GET_INFO = 0;
797
808
  const GET_PAYLOAD_LENGTH_16 = 1;
@@ -810,6 +821,8 @@
810
821
  this._binaryType = options.binaryType || BINARY_TYPES[0];
811
822
  this._extensions = options.extensions || {};
812
823
  this._isServer = !!options.isServer;
824
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
825
+ this._maxFragments = options.maxFragments | 0;
813
826
  this._maxPayload = options.maxPayload | 0;
814
827
  this._skipUTF8Validation = !!options.skipUTF8Validation;
815
828
  this[kWebSocket] = undefined;
@@ -831,6 +844,21 @@
831
844
  }
832
845
  _write(chunk, encoding, cb) {
833
846
  if (this._opcode === 8 && this._state == GET_INFO) return cb();
847
+ if (
848
+ this._maxBufferedChunks > 0 &&
849
+ this._buffers.length >= this._maxBufferedChunks
850
+ ) {
851
+ cb(
852
+ this.createError(
853
+ RangeError,
854
+ "Too many buffered chunks",
855
+ false,
856
+ 1008,
857
+ "WS_ERR_TOO_MANY_BUFFERED_PARTS",
858
+ ),
859
+ );
860
+ return;
861
+ }
834
862
  this._bufferedBytes += chunk.length;
835
863
  this._buffers.push(chunk);
836
864
  this.startLoop(cb);
@@ -1129,6 +1157,20 @@
1129
1157
  return;
1130
1158
  }
1131
1159
  if (data.length) {
1160
+ if (
1161
+ this._maxFragments > 0 &&
1162
+ this._fragments.length >= this._maxFragments
1163
+ ) {
1164
+ const error = this.createError(
1165
+ RangeError,
1166
+ "Too many message fragments",
1167
+ false,
1168
+ 1008,
1169
+ "WS_ERR_TOO_MANY_BUFFERED_PARTS",
1170
+ );
1171
+ cb(error);
1172
+ return;
1173
+ }
1132
1174
  this._messageLength = this._totalPayloadLength;
1133
1175
  this._fragments.push(data);
1134
1176
  }
@@ -1155,6 +1197,20 @@
1155
1197
  cb(error);
1156
1198
  return;
1157
1199
  }
1200
+ if (
1201
+ this._maxFragments > 0 &&
1202
+ this._fragments.length >= this._maxFragments
1203
+ ) {
1204
+ const error = this.createError(
1205
+ RangeError,
1206
+ "Too many message fragments",
1207
+ false,
1208
+ 1008,
1209
+ "WS_ERR_TOO_MANY_BUFFERED_PARTS",
1210
+ );
1211
+ cb(error);
1212
+ return;
1213
+ }
1158
1214
  this._fragments.push(buf);
1159
1215
  }
1160
1216
  this.dataMessage(cb);
@@ -1288,14 +1344,17 @@
1288
1344
  }
1289
1345
  module.exports = Receiver;
1290
1346
  },
1291
- 480: (module, __unused_webpack_exports, __nccwpck_require__) => {
1347
+ 243: (module, __unused_webpack_exports, __nccwpck_require__) => {
1292
1348
  "use strict";
1293
1349
  const { Duplex } = __nccwpck_require__(203);
1294
1350
  const { randomFillSync } = __nccwpck_require__(982);
1295
- const PerMessageDeflate = __nccwpck_require__(465);
1296
- const { EMPTY_BUFFER, kWebSocket, NOOP } = __nccwpck_require__(892);
1297
- const { isBlob, isValidStatusCode } = __nccwpck_require__(342);
1298
- const { mask: applyMask, toBuffer } = __nccwpck_require__(72);
1351
+ const {
1352
+ types: { isUint8Array },
1353
+ } = __nccwpck_require__(23);
1354
+ const PerMessageDeflate = __nccwpck_require__(86);
1355
+ const { EMPTY_BUFFER, kWebSocket, NOOP } = __nccwpck_require__(149);
1356
+ const { isBlob, isValidStatusCode } = __nccwpck_require__(125);
1357
+ const { mask: applyMask, toBuffer } = __nccwpck_require__(393);
1299
1358
  const kByteLength = Symbol("kByteLength");
1300
1359
  const maskBuffer = Buffer.alloc(4);
1301
1360
  const RANDOM_POOL_SIZE = 8 * 1024;
@@ -1416,8 +1475,12 @@
1416
1475
  buf.writeUInt16BE(code, 0);
1417
1476
  if (typeof data === "string") {
1418
1477
  buf.write(data, 2);
1419
- } else {
1478
+ } else if (isUint8Array(data)) {
1420
1479
  buf.set(data, 2);
1480
+ } else {
1481
+ throw new TypeError(
1482
+ "Second argument must be a string or a Uint8Array",
1483
+ );
1421
1484
  }
1422
1485
  }
1423
1486
  const options = {
@@ -1664,9 +1727,9 @@
1664
1727
  sender.onerror(err);
1665
1728
  }
1666
1729
  },
1667
- 297: (module, __unused_webpack_exports, __nccwpck_require__) => {
1730
+ 614: (module, __unused_webpack_exports, __nccwpck_require__) => {
1668
1731
  "use strict";
1669
- const WebSocket = __nccwpck_require__(234);
1732
+ const WebSocket = __nccwpck_require__(983);
1670
1733
  const { Duplex } = __nccwpck_require__(203);
1671
1734
  function emitClose(stream) {
1672
1735
  stream.emit("close");
@@ -1761,9 +1824,9 @@
1761
1824
  }
1762
1825
  module.exports = createWebSocketStream;
1763
1826
  },
1764
- 31: (module, __unused_webpack_exports, __nccwpck_require__) => {
1827
+ 94: (module, __unused_webpack_exports, __nccwpck_require__) => {
1765
1828
  "use strict";
1766
- const { tokenChars } = __nccwpck_require__(342);
1829
+ const { tokenChars } = __nccwpck_require__(125);
1767
1830
  function parse(header) {
1768
1831
  const protocols = new Set();
1769
1832
  let start = -1;
@@ -1804,10 +1867,10 @@
1804
1867
  }
1805
1868
  module.exports = { parse };
1806
1869
  },
1807
- 342: (module, __unused_webpack_exports, __nccwpck_require__) => {
1870
+ 125: (module, __unused_webpack_exports, __nccwpck_require__) => {
1808
1871
  "use strict";
1809
1872
  const { isUtf8 } = __nccwpck_require__(181);
1810
- const { hasBlob } = __nccwpck_require__(892);
1873
+ const { hasBlob } = __nccwpck_require__(149);
1811
1874
  const tokenChars = [
1812
1875
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1813
1876
  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
@@ -1901,17 +1964,17 @@
1901
1964
  } catch (e) {}
1902
1965
  }
1903
1966
  },
1904
- 788: (module, __unused_webpack_exports, __nccwpck_require__) => {
1967
+ 624: (module, __unused_webpack_exports, __nccwpck_require__) => {
1905
1968
  "use strict";
1906
1969
  const EventEmitter = __nccwpck_require__(434);
1907
1970
  const http = __nccwpck_require__(611);
1908
1971
  const { Duplex } = __nccwpck_require__(203);
1909
1972
  const { createHash } = __nccwpck_require__(982);
1910
- const extension = __nccwpck_require__(468);
1911
- const PerMessageDeflate = __nccwpck_require__(465);
1912
- const subprotocol = __nccwpck_require__(31);
1913
- const WebSocket = __nccwpck_require__(234);
1914
- const { GUID, kWebSocket } = __nccwpck_require__(892);
1973
+ const extension = __nccwpck_require__(165);
1974
+ const PerMessageDeflate = __nccwpck_require__(86);
1975
+ const subprotocol = __nccwpck_require__(94);
1976
+ const WebSocket = __nccwpck_require__(983);
1977
+ const { CLOSE_TIMEOUT, GUID, kWebSocket } = __nccwpck_require__(149);
1915
1978
  const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
1916
1979
  const RUNNING = 0;
1917
1980
  const CLOSING = 1;
@@ -1922,11 +1985,14 @@
1922
1985
  options = {
1923
1986
  allowSynchronousEvents: true,
1924
1987
  autoPong: true,
1988
+ maxBufferedChunks: 1024 * 1024,
1989
+ maxFragments: 128 * 1024,
1925
1990
  maxPayload: 100 * 1024 * 1024,
1926
1991
  skipUTF8Validation: false,
1927
1992
  perMessageDeflate: false,
1928
1993
  handleProtocols: null,
1929
1994
  clientTracking: true,
1995
+ closeTimeout: CLOSE_TIMEOUT,
1930
1996
  verifyClient: null,
1931
1997
  noServer: false,
1932
1998
  backlog: null,
@@ -2090,11 +2156,11 @@
2090
2156
  this.options.perMessageDeflate &&
2091
2157
  secWebSocketExtensions !== undefined
2092
2158
  ) {
2093
- const perMessageDeflate = new PerMessageDeflate(
2094
- this.options.perMessageDeflate,
2095
- true,
2096
- this.options.maxPayload,
2097
- );
2159
+ const perMessageDeflate = new PerMessageDeflate({
2160
+ ...this.options.perMessageDeflate,
2161
+ isServer: true,
2162
+ maxPayload: this.options.maxPayload,
2163
+ });
2098
2164
  try {
2099
2165
  const offers = extension.parse(secWebSocketExtensions);
2100
2166
  if (offers[PerMessageDeflate.extensionName]) {
@@ -2204,6 +2270,8 @@
2204
2270
  socket.removeListener("error", socketOnError);
2205
2271
  ws.setSocket(socket, head, {
2206
2272
  allowSynchronousEvents: this.options.allowSynchronousEvents,
2273
+ maxBufferedChunks: this.options.maxBufferedChunks,
2274
+ maxFragments: this.options.maxFragments,
2207
2275
  maxPayload: this.options.maxPayload,
2208
2276
  skipUTF8Validation: this.options.skipUTF8Validation,
2209
2277
  });
@@ -2270,7 +2338,7 @@
2270
2338
  }
2271
2339
  }
2272
2340
  },
2273
- 234: (module, __unused_webpack_exports, __nccwpck_require__) => {
2341
+ 983: (module, __unused_webpack_exports, __nccwpck_require__) => {
2274
2342
  "use strict";
2275
2343
  const EventEmitter = __nccwpck_require__(434);
2276
2344
  const https = __nccwpck_require__(692);
@@ -2280,12 +2348,13 @@
2280
2348
  const { randomBytes, createHash } = __nccwpck_require__(982);
2281
2349
  const { Duplex, Readable } = __nccwpck_require__(203);
2282
2350
  const { URL } = __nccwpck_require__(16);
2283
- const PerMessageDeflate = __nccwpck_require__(465);
2284
- const Receiver = __nccwpck_require__(176);
2285
- const Sender = __nccwpck_require__(480);
2286
- const { isBlob } = __nccwpck_require__(342);
2351
+ const PerMessageDeflate = __nccwpck_require__(86);
2352
+ const Receiver = __nccwpck_require__(479);
2353
+ const Sender = __nccwpck_require__(243);
2354
+ const { isBlob } = __nccwpck_require__(125);
2287
2355
  const {
2288
2356
  BINARY_TYPES,
2357
+ CLOSE_TIMEOUT,
2289
2358
  EMPTY_BUFFER,
2290
2359
  GUID,
2291
2360
  kForOnEventAttribute,
@@ -2293,13 +2362,12 @@
2293
2362
  kStatusCode,
2294
2363
  kWebSocket,
2295
2364
  NOOP,
2296
- } = __nccwpck_require__(892);
2365
+ } = __nccwpck_require__(149);
2297
2366
  const {
2298
2367
  EventTarget: { addEventListener, removeEventListener },
2299
- } = __nccwpck_require__(95);
2300
- const { format, parse } = __nccwpck_require__(468);
2301
- const { toBuffer } = __nccwpck_require__(72);
2302
- const closeTimeout = 30 * 1e3;
2368
+ } = __nccwpck_require__(332);
2369
+ const { format, parse } = __nccwpck_require__(165);
2370
+ const { toBuffer } = __nccwpck_require__(393);
2303
2371
  const kAborted = Symbol("kAborted");
2304
2372
  const protocolVersions = [8, 13];
2305
2373
  const readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
@@ -2338,6 +2406,7 @@
2338
2406
  initAsClient(this, address, protocols, options);
2339
2407
  } else {
2340
2408
  this._autoPong = options.autoPong;
2409
+ this._closeTimeout = options.closeTimeout;
2341
2410
  this._isServer = true;
2342
2411
  }
2343
2412
  }
@@ -2388,6 +2457,8 @@
2388
2457
  binaryType: this.binaryType,
2389
2458
  extensions: this._extensions,
2390
2459
  isServer: this._isServer,
2460
+ maxBufferedChunks: options.maxBufferedChunks,
2461
+ maxFragments: options.maxFragments,
2391
2462
  maxPayload: options.maxPayload,
2392
2463
  skipUTF8Validation: options.skipUTF8Validation,
2393
2464
  });
@@ -2635,7 +2706,10 @@
2635
2706
  const opts = {
2636
2707
  allowSynchronousEvents: true,
2637
2708
  autoPong: true,
2709
+ closeTimeout: CLOSE_TIMEOUT,
2638
2710
  protocolVersion: protocolVersions[1],
2711
+ maxBufferedChunks: 1024 * 1024,
2712
+ maxFragments: 128 * 1024,
2639
2713
  maxPayload: 100 * 1024 * 1024,
2640
2714
  skipUTF8Validation: false,
2641
2715
  perMessageDeflate: true,
@@ -2652,6 +2726,7 @@
2652
2726
  port: undefined,
2653
2727
  };
2654
2728
  websocket._autoPong = opts.autoPong;
2729
+ websocket._closeTimeout = opts.closeTimeout;
2655
2730
  if (!protocolVersions.includes(opts.protocolVersion)) {
2656
2731
  throw new RangeError(
2657
2732
  `Unsupported protocol version: ${opts.protocolVersion} ` +
@@ -2664,7 +2739,7 @@
2664
2739
  } else {
2665
2740
  try {
2666
2741
  parsedUrl = new URL(address);
2667
- } catch (e) {
2742
+ } catch {
2668
2743
  throw new SyntaxError(`Invalid URL: ${address}`);
2669
2744
  }
2670
2745
  }
@@ -2717,11 +2792,11 @@
2717
2792
  opts.path = parsedUrl.pathname + parsedUrl.search;
2718
2793
  opts.timeout = opts.handshakeTimeout;
2719
2794
  if (opts.perMessageDeflate) {
2720
- perMessageDeflate = new PerMessageDeflate(
2721
- opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
2722
- false,
2723
- opts.maxPayload,
2724
- );
2795
+ perMessageDeflate = new PerMessageDeflate({
2796
+ ...opts.perMessageDeflate,
2797
+ isServer: false,
2798
+ maxPayload: opts.maxPayload,
2799
+ });
2725
2800
  opts.headers["Sec-WebSocket-Extensions"] = format({
2726
2801
  [PerMessageDeflate.extensionName]: perMessageDeflate.offer(),
2727
2802
  });
@@ -2917,6 +2992,8 @@
2917
2992
  websocket.setSocket(socket, head, {
2918
2993
  allowSynchronousEvents: opts.allowSynchronousEvents,
2919
2994
  generateMask: opts.generateMask,
2995
+ maxBufferedChunks: opts.maxBufferedChunks,
2996
+ maxFragments: opts.maxFragments,
2920
2997
  maxPayload: opts.maxPayload,
2921
2998
  skipUTF8Validation: opts.skipUTF8Validation,
2922
2999
  });
@@ -3035,7 +3112,7 @@
3035
3112
  function setCloseTimer(websocket) {
3036
3113
  websocket._closeTimer = setTimeout(
3037
3114
  websocket._socket.destroy.bind(websocket._socket),
3038
- closeTimeout,
3115
+ websocket._closeTimeout,
3039
3116
  );
3040
3117
  }
3041
3118
  function socketOnClose() {
@@ -3044,13 +3121,13 @@
3044
3121
  this.removeListener("data", socketOnData);
3045
3122
  this.removeListener("end", socketOnEnd);
3046
3123
  websocket._readyState = WebSocket.CLOSING;
3047
- let chunk;
3048
3124
  if (
3049
3125
  !this._readableState.endEmitted &&
3050
3126
  !websocket._closeFrameReceived &&
3051
3127
  !websocket._receiver._writableState.errorEmitted &&
3052
- (chunk = websocket._socket.read()) !== null
3128
+ this._readableState.length !== 0
3053
3129
  ) {
3130
+ const chunk = this.read(this._readableState.length);
3054
3131
  websocket._receiver.write(chunk);
3055
3132
  }
3056
3133
  websocket._receiver.end();
@@ -3129,6 +3206,10 @@
3129
3206
  "use strict";
3130
3207
  module.exports = require("url");
3131
3208
  },
3209
+ 23: (module) => {
3210
+ "use strict";
3211
+ module.exports = require("util");
3212
+ },
3132
3213
  106: (module) => {
3133
3214
  "use strict";
3134
3215
  module.exports = require("zlib");
@@ -3156,6 +3237,6 @@
3156
3237
  }
3157
3238
  if (typeof __nccwpck_require__ !== "undefined")
3158
3239
  __nccwpck_require__.ab = __dirname + "/";
3159
- var __webpack_exports__ = __nccwpck_require__(821);
3240
+ var __webpack_exports__ = __nccwpck_require__(252);
3160
3241
  module.exports = __webpack_exports__;
3161
3242
  })();
@@ -1 +1 @@
1
- {"name":"ws","author":"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)","version":"8.18.3","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"ws","author":"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)","version":"8.21.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/131.js CHANGED
@@ -3566,7 +3566,7 @@ function createPublicContext(context) {
3566
3566
  async function createContext(options, userConfig) {
3567
3567
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3568
3568
  return {
3569
- version: "1.7.5",
3569
+ version: "1.7.6",
3570
3570
  rootPath,
3571
3571
  distPath: '',
3572
3572
  cachePath,
@@ -9211,7 +9211,7 @@ let applyServerOptions = (command)=>{
9211
9211
  };
9212
9212
  function setupCommands() {
9213
9213
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9214
- cli.version("1.7.5"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9214
+ cli.version("1.7.6"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9215
9215
  default: 'auto'
9216
9216
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9217
9217
  type: [
@@ -9280,7 +9280,7 @@ function initNodeEnv() {
9280
9280
  }
9281
9281
  function showGreeting() {
9282
9282
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9283
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.5\n`);
9283
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.6\n`);
9284
9284
  }
9285
9285
  function setupLogLevel() {
9286
9286
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9301,5 +9301,5 @@ function runCLI() {
9301
9301
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
9302
9302
  }
9303
9303
  }
9304
- let src_version = "1.7.5";
9304
+ let src_version = "1.7.6";
9305
9305
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, node_fs, node_os, node_process, rspack_rspack as rspack, runCLI, src_logger as logger, src_version as version };
package/dist/index.cjs CHANGED
@@ -3700,7 +3700,7 @@ ${section.body}` : section.body).join("\n\n"));
3700
3700
  async function createContext(options, userConfig) {
3701
3701
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3702
3702
  return {
3703
- version: "1.7.5",
3703
+ version: "1.7.6",
3704
3704
  rootPath,
3705
3705
  distPath: '',
3706
3706
  cachePath,
@@ -9345,7 +9345,7 @@ try {
9345
9345
  };
9346
9346
  function setupCommands() {
9347
9347
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9348
- cli.version("1.7.5"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9348
+ cli.version("1.7.6"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9349
9349
  default: 'auto'
9350
9350
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9351
9351
  type: [
@@ -9414,7 +9414,7 @@ try {
9414
9414
  }
9415
9415
  function showGreeting() {
9416
9416
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9417
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.5\n`);
9417
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.6\n`);
9418
9418
  }
9419
9419
  function setupLogLevel() {
9420
9420
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9435,7 +9435,7 @@ try {
9435
9435
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
9436
9436
  }
9437
9437
  }
9438
- let src_version = "1.7.5";
9438
+ let src_version = "1.7.6";
9439
9439
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
9440
9440
  "PLUGIN_CSS_NAME",
9441
9441
  "PLUGIN_SWC_NAME",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -96,7 +96,7 @@
96
96
  "webpack": "^5.104.1",
97
97
  "webpack-bundle-analyzer": "^5.3.0",
98
98
  "webpack-merge": "6.0.1",
99
- "ws": "^8.18.3"
99
+ "ws": "^8.21.0"
100
100
  },
101
101
  "engines": {
102
102
  "node": ">=18.12.0"