@rsbuild/core 1.0.1-rc.2 → 1.0.1-rc.4

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,22 +1,22 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 4327: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 1668: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(1566);
5
+ const loader = __nccwpck_require__(5288);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(1628).defaultGetLocalIdent;
8
+ __nccwpck_require__(9049).defaultGetLocalIdent;
9
9
  },
10
- 1566: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 5288: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(9961));
15
15
  var _package = _interopRequireDefault(__nccwpck_require__(2321));
16
16
  var _semver = __nccwpck_require__(938);
17
- var _options = _interopRequireDefault(__nccwpck_require__(2175));
18
- var _plugins = __nccwpck_require__(3827);
19
- var _utils = __nccwpck_require__(1628);
17
+ var _options = _interopRequireDefault(__nccwpck_require__(9965));
18
+ var _plugins = __nccwpck_require__(7723);
19
+ var _utils = __nccwpck_require__(9049);
20
20
  function _interopRequireDefault(obj) {
21
21
  return obj && obj.__esModule ? obj : { default: obj };
22
22
  }
@@ -243,7 +243,7 @@
243
243
  callback(null, `${importCode}${moduleCode}${exportCode}`);
244
244
  }
245
245
  },
246
- 3827: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 7723: (__unused_webpack_module, exports, __nccwpck_require__) => {
247
247
  "use strict";
248
248
  Object.defineProperty(exports, "__esModule", { value: true });
249
249
  Object.defineProperty(exports, "icssParser", {
@@ -265,22 +265,22 @@
265
265
  },
266
266
  });
267
267
  var _postcssImportParser = _interopRequireDefault(
268
- __nccwpck_require__(1096),
268
+ __nccwpck_require__(5583),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(6024),
271
+ __nccwpck_require__(1789),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(976));
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(9758));
274
274
  function _interopRequireDefault(obj) {
275
275
  return obj && obj.__esModule ? obj : { default: obj };
276
276
  }
277
277
  },
278
- 6024: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 1789: (__unused_webpack_module, exports, __nccwpck_require__) => {
279
279
  "use strict";
280
280
  Object.defineProperty(exports, "__esModule", { value: true });
281
281
  exports["default"] = void 0;
282
282
  var _icssUtils = __nccwpck_require__(9598);
283
- var _utils = __nccwpck_require__(1628);
283
+ var _utils = __nccwpck_require__(9049);
284
284
  const plugin = (options = {}) => ({
285
285
  postcssPlugin: "postcss-icss-parser",
286
286
  async OnceExit(root) {
@@ -379,14 +379,14 @@
379
379
  plugin.postcss = true;
380
380
  var _default = (exports["default"] = plugin);
381
381
  },
382
- 1096: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 5583: (__unused_webpack_module, exports, __nccwpck_require__) => {
383
383
  "use strict";
384
384
  Object.defineProperty(exports, "__esModule", { value: true });
385
385
  exports["default"] = void 0;
386
386
  var _postcssValueParser = _interopRequireDefault(
387
387
  __nccwpck_require__(7555),
388
388
  );
389
- var _utils = __nccwpck_require__(1628);
389
+ var _utils = __nccwpck_require__(9049);
390
390
  function _interopRequireDefault(obj) {
391
391
  return obj && obj.__esModule ? obj : { default: obj };
392
392
  }
@@ -691,14 +691,14 @@
691
691
  plugin.postcss = true;
692
692
  var _default = (exports["default"] = plugin);
693
693
  },
694
- 976: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 9758: (__unused_webpack_module, exports, __nccwpck_require__) => {
695
695
  "use strict";
696
696
  Object.defineProperty(exports, "__esModule", { value: true });
697
697
  exports["default"] = void 0;
698
698
  var _postcssValueParser = _interopRequireDefault(
699
699
  __nccwpck_require__(7555),
700
700
  );
701
- var _utils = __nccwpck_require__(1628);
701
+ var _utils = __nccwpck_require__(9049);
702
702
  function _interopRequireDefault(obj) {
703
703
  return obj && obj.__esModule ? obj : { default: obj };
704
704
  }
@@ -1041,7 +1041,7 @@
1041
1041
  plugin.postcss = true;
1042
1042
  var _default = (exports["default"] = plugin);
1043
1043
  },
1044
- 1628: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 9049: (__unused_webpack_module, exports, __nccwpck_require__) => {
1045
1045
  "use strict";
1046
1046
  Object.defineProperty(exports, "__esModule", { value: true });
1047
1047
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -7964,7 +7964,7 @@
7964
7964
  "use strict";
7965
7965
  module.exports = require("util");
7966
7966
  },
7967
- 2175: (module) => {
7967
+ 9965: (module) => {
7968
7968
  "use strict";
7969
7969
  module.exports = JSON.parse(
7970
7970
  '{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack-contrib/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack-contrib/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack-contrib/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack-contrib/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack-contrib/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack-contrib/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack-contrib/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack-contrib/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack-contrib/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack-contrib/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack-contrib/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack-contrib/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack-contrib/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack-contrib/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack-contrib/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
@@ -7999,6 +7999,6 @@
7999
7999
  }
8000
8000
  if (typeof __nccwpck_require__ !== "undefined")
8001
8001
  __nccwpck_require__.ab = __dirname + "/";
8002
- var __webpack_exports__ = __nccwpck_require__(4327);
8002
+ var __webpack_exports__ = __nccwpck_require__(1668);
8003
8003
  module.exports = __webpack_exports__;
8004
8004
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 97: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 335: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(954);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(221);
6
6
  const compilerMap = new WeakMap();
7
7
  class CachedChildCompilation {
8
8
  constructor(compiler) {
@@ -304,7 +304,7 @@
304
304
  }
305
305
  module.exports = { CachedChildCompilation };
306
306
  },
307
- 954: (module) => {
307
+ 221: (module) => {
308
308
  "use strict";
309
309
  class HtmlWebpackChildCompiler {
310
310
  constructor(templates) {
@@ -465,7 +465,7 @@
465
465
  }
466
466
  module.exports = { HtmlWebpackChildCompiler };
467
467
  },
468
- 668: (module) => {
468
+ 810: (module) => {
469
469
  "use strict";
470
470
  module.exports = {};
471
471
  module.exports.none = (chunks) => chunks;
@@ -484,7 +484,7 @@
484
484
  };
485
485
  module.exports.auto = module.exports.none;
486
486
  },
487
- 822: (module) => {
487
+ 640: (module) => {
488
488
  "use strict";
489
489
  module.exports = function (err) {
490
490
  return {
@@ -505,7 +505,7 @@
505
505
  };
506
506
  };
507
507
  },
508
- 860: (module, __unused_webpack_exports, __nccwpck_require__) => {
508
+ 349: (module, __unused_webpack_exports, __nccwpck_require__) => {
509
509
  "use strict";
510
510
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(348);
511
511
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -531,7 +531,7 @@
531
531
  }
532
532
  module.exports = { getHtmlRspackPluginHooks };
533
533
  },
534
- 646: (module) => {
534
+ 533: (module) => {
535
535
  const voidTags = [
536
536
  "area",
537
537
  "base",
@@ -599,19 +599,19 @@
599
599
  htmlTagObjectToString,
600
600
  };
601
601
  },
602
- 719: (module, __unused_webpack_exports, __nccwpck_require__) => {
602
+ 870: (module, __unused_webpack_exports, __nccwpck_require__) => {
603
603
  "use strict";
604
604
  const promisify = __nccwpck_require__(837).promisify;
605
605
  const vm = __nccwpck_require__(144);
606
606
  const fs = __nccwpck_require__(147);
607
607
  const path = __nccwpck_require__(17);
608
- const { CachedChildCompilation } = __nccwpck_require__(97);
608
+ const { CachedChildCompilation } = __nccwpck_require__(335);
609
609
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
610
- __nccwpck_require__(646);
611
- const prettyError = __nccwpck_require__(822);
612
- const chunkSorter = __nccwpck_require__(668);
610
+ __nccwpck_require__(533);
611
+ const prettyError = __nccwpck_require__(640);
612
+ const chunkSorter = __nccwpck_require__(810);
613
613
  const getHtmlRspackPluginHooks =
614
- __nccwpck_require__(860).getHtmlRspackPluginHooks;
614
+ __nccwpck_require__(349).getHtmlRspackPluginHooks;
615
615
  class HtmlRspackPlugin {
616
616
  constructor(userOptions = {}) {
617
617
  this.version = HtmlRspackPlugin.version;
@@ -1569,6 +1569,6 @@
1569
1569
  }
1570
1570
  if (typeof __nccwpck_require__ !== "undefined")
1571
1571
  __nccwpck_require__.ab = __dirname + "/";
1572
- var __webpack_exports__ = __nccwpck_require__(719);
1572
+ var __webpack_exports__ = __nccwpck_require__(870);
1573
1573
  module.exports = __webpack_exports__;
1574
1574
  })();
@@ -2,6 +2,7 @@ type Formatter = (input: string | number | null | undefined) => string
2
2
 
3
3
  interface Colors {
4
4
  isColorSupported: boolean
5
+
5
6
  reset: Formatter
6
7
  bold: Formatter
7
8
  dim: Formatter
@@ -10,6 +11,7 @@ interface Colors {
10
11
  inverse: Formatter
11
12
  hidden: Formatter
12
13
  strikethrough: Formatter
14
+
13
15
  black: Formatter
14
16
  red: Formatter
15
17
  green: Formatter
@@ -19,6 +21,7 @@ interface Colors {
19
21
  cyan: Formatter
20
22
  white: Formatter
21
23
  gray: Formatter
24
+
22
25
  bgBlack: Formatter
23
26
  bgRed: Formatter
24
27
  bgGreen: Formatter
@@ -27,6 +30,25 @@ interface Colors {
27
30
  bgMagenta: Formatter
28
31
  bgCyan: Formatter
29
32
  bgWhite: Formatter
33
+
34
+ blackBright: Formatter
35
+ redBright: Formatter
36
+ greenBright: Formatter
37
+ yellowBright: Formatter
38
+ blueBright: Formatter
39
+ magentaBright: Formatter
40
+ cyanBright: Formatter
41
+ whiteBright: Formatter
42
+
43
+ bgBlackBright: Formatter
44
+ bgRedBright: Formatter
45
+ bgGreenBright: Formatter
46
+ bgYellowBright: Formatter
47
+ bgBlueBright: Formatter
48
+ bgMagentaBright: Formatter
49
+ bgCyanBright: Formatter
50
+ bgWhiteBright: Formatter
51
+
30
52
  }
31
53
 
32
54
  declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 701: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 78: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  let argv = process.argv || [],
5
5
  env = process.env;
6
6
  let isColorSupported =
@@ -60,6 +60,22 @@
60
60
  bgMagenta: init("", ""),
61
61
  bgCyan: init("", ""),
62
62
  bgWhite: init("", ""),
63
+ blackBright: init("", ""),
64
+ redBright: init("", ""),
65
+ greenBright: init("", ""),
66
+ yellowBright: init("", ""),
67
+ blueBright: init("", ""),
68
+ magentaBright: init("", ""),
69
+ cyanBright: init("", ""),
70
+ whiteBright: init("", ""),
71
+ bgBlackBright: init("", ""),
72
+ bgRedBright: init("", ""),
73
+ bgGreenBright: init("", ""),
74
+ bgYellowBright: init("", ""),
75
+ bgBlueBright: init("", ""),
76
+ bgMagentaBright: init("", ""),
77
+ bgCyanBright: init("", ""),
78
+ bgWhiteBright: init("", ""),
63
79
  };
64
80
  };
65
81
  module.exports = createColors();
@@ -92,6 +108,6 @@
92
108
  }
93
109
  if (typeof __nccwpck_require__ !== "undefined")
94
110
  __nccwpck_require__.ab = __dirname + "/";
95
- var __webpack_exports__ = __nccwpck_require__(701);
111
+ var __webpack_exports__ = __nccwpck_require__(78);
96
112
  module.exports = __webpack_exports__;
97
113
  })();
@@ -1,6 +1,6 @@
1
1
  ISC License
2
2
 
3
- Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
3
+ Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
@@ -1 +1 @@
1
- {"name":"picocolors","author":"Alexey Raspopov","version":"1.0.1","license":"ISC","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"picocolors","author":"Alexey Raspopov","version":"1.1.0","license":"ISC","types":"index.d.ts","type":"commonjs"}
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 701: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 78: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  let argv = process.argv || [],
5
5
  env = process.env;
6
6
  let isColorSupported =
@@ -60,6 +60,22 @@
60
60
  bgMagenta: init("", ""),
61
61
  bgCyan: init("", ""),
62
62
  bgWhite: init("", ""),
63
+ blackBright: init("", ""),
64
+ redBright: init("", ""),
65
+ greenBright: init("", ""),
66
+ yellowBright: init("", ""),
67
+ blueBright: init("", ""),
68
+ magentaBright: init("", ""),
69
+ cyanBright: init("", ""),
70
+ whiteBright: init("", ""),
71
+ bgBlackBright: init("", ""),
72
+ bgRedBright: init("", ""),
73
+ bgGreenBright: init("", ""),
74
+ bgYellowBright: init("", ""),
75
+ bgBlueBright: init("", ""),
76
+ bgMagentaBright: init("", ""),
77
+ bgCyanBright: init("", ""),
78
+ bgWhiteBright: init("", ""),
63
79
  };
64
80
  };
65
81
  module.exports = createColors();
@@ -483,7 +499,7 @@
483
499
  },
484
500
  804: (module, __unused_webpack_exports, __nccwpck_require__) => {
485
501
  "use strict";
486
- let pico = __nccwpck_require__(701);
502
+ let pico = __nccwpck_require__(78);
487
503
  let terminalHighlight = __nccwpck_require__(205);
488
504
  class CssSyntaxError extends Error {
489
505
  constructor(message, line, column, source, file, plugin) {
@@ -3488,7 +3504,7 @@
3488
3504
  },
3489
3505
  205: (module, __unused_webpack_exports, __nccwpck_require__) => {
3490
3506
  "use strict";
3491
- let pico = __nccwpck_require__(701);
3507
+ let pico = __nccwpck_require__(78);
3492
3508
  let tokenizer = __nccwpck_require__(625);
3493
3509
  let Input;
3494
3510
  function registerInput(dependant) {
@@ -1,17 +1,17 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 380: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(234)["default"];
4
+ 105: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(449)["default"];
6
6
  },
7
- 234: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 449: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = loader;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(17));
12
12
  var _package = _interopRequireDefault(__nccwpck_require__(321));
13
- var _options = _interopRequireDefault(__nccwpck_require__(310));
14
- var _utils = __nccwpck_require__(97);
13
+ var _options = _interopRequireDefault(__nccwpck_require__(969));
14
+ var _utils = __nccwpck_require__(371);
15
15
  function _interopRequireDefault(obj) {
16
16
  return obj && obj.__esModule ? obj : { default: obj };
17
17
  }
@@ -189,7 +189,7 @@
189
189
  callback(null, result.css, map, { ast });
190
190
  }
191
191
  },
192
- 97: (module, exports, __nccwpck_require__) => {
192
+ 371: (module, exports, __nccwpck_require__) => {
193
193
  module = __nccwpck_require__.nmd(module);
194
194
  Object.defineProperty(exports, "__esModule", { value: true });
195
195
  exports.exec = exec;
@@ -202,7 +202,7 @@
202
202
  exports.reportError = reportError;
203
203
  exports.warningFactory = warningFactory;
204
204
  var _path = _interopRequireDefault(__nccwpck_require__(17));
205
- var _url = _interopRequireDefault(__nccwpck_require__(34));
205
+ var _url = _interopRequireDefault(__nccwpck_require__(310));
206
206
  var _module = _interopRequireDefault(__nccwpck_require__(188));
207
207
  var _cosmiconfig = {};
208
208
  function _interopRequireDefault(obj) {
@@ -691,10 +691,10 @@
691
691
  17: (module) => {
692
692
  module.exports = require("path");
693
693
  },
694
- 34: (module) => {
694
+ 310: (module) => {
695
695
  module.exports = require("url");
696
696
  },
697
- 310: (module) => {
697
+ 969: (module) => {
698
698
  module.exports = JSON.parse(
699
699
  '{"title":"PostCSS Loader options","type":"object","properties":{"postcssOptions":{"description":"Options to pass through to `Postcss`.","link":"https://github.com/webpack-contrib/postcss-loader#postcssOptions","anyOf":[{"type":"object","additionalProperties":true,"properties":{"config":{"description":"Allows to specify PostCSS config path.","link":"https://github.com/webpack-contrib/postcss-loader#config","anyOf":[{"description":"Allows to specify the path to the configuration file","type":"string"},{"description":"Enables/Disables autoloading config","type":"boolean"}]}}},{"instanceof":"Function"}]},"execute":{"description":"Enables/Disables PostCSS parser support in \'CSS-in-JS\'.","link":"https://github.com/webpack-contrib/postcss-loader#execute","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/postcss-loader#sourcemap","type":"boolean"},"implementation":{"description":"The implementation of postcss to use, instead of the locally installed version","link":"https://github.com/webpack-contrib/postcss-loader#implementation","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
700
700
  );
@@ -739,6 +739,6 @@
739
739
  })();
740
740
  if (typeof __nccwpck_require__ !== "undefined")
741
741
  __nccwpck_require__.ab = __dirname + "/";
742
- var __webpack_exports__ = __nccwpck_require__(380);
742
+ var __webpack_exports__ = __nccwpck_require__(105);
743
743
  module.exports = __webpack_exports__;
744
744
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 598: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 107: (__unused_webpack_module, exports, __nccwpck_require__) => {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.transformFiles =
7
7
  exports.reduceChunk =
@@ -120,7 +120,7 @@
120
120
  .map(standardizeFilePaths);
121
121
  exports.transformFiles = transformFiles;
122
122
  },
123
- 991: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 428: (__unused_webpack_module, exports, __nccwpck_require__) => {
124
124
  Object.defineProperty(exports, "__esModule", { value: true });
125
125
  exports.normalModuleLoaderHook =
126
126
  exports.getCompilerHooks =
@@ -130,7 +130,7 @@
130
130
  const fs_1 = __nccwpck_require__(147);
131
131
  const path_1 = __nccwpck_require__(17);
132
132
  const lite_tapable_1 = __nccwpck_require__(348);
133
- const helpers_1 = __nccwpck_require__(598);
133
+ const helpers_1 = __nccwpck_require__(107);
134
134
  const compilerHookMap = new WeakMap();
135
135
  const getCompilerHooks = (compiler) => {
136
136
  let hooks = compilerHookMap.get(compiler);
@@ -312,7 +312,7 @@
312
312
  exports.getCompilerHooks =
313
313
  void 0;
314
314
  const path_1 = __nccwpck_require__(17);
315
- const hooks_1 = __nccwpck_require__(991);
315
+ const hooks_1 = __nccwpck_require__(428);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
@@ -8903,7 +8903,7 @@
8903
8903
  return childProcess.execFile(command, args, options, callback);
8904
8904
  };
8905
8905
  },
8906
- 701: (module, __unused_webpack_exports, __nccwpck_require__) => {
8906
+ 78: (module, __unused_webpack_exports, __nccwpck_require__) => {
8907
8907
  let argv = process.argv || [],
8908
8908
  env = process.env;
8909
8909
  let isColorSupported =
@@ -8963,6 +8963,22 @@
8963
8963
  bgMagenta: init("", ""),
8964
8964
  bgCyan: init("", ""),
8965
8965
  bgWhite: init("", ""),
8966
+ blackBright: init("", ""),
8967
+ redBright: init("", ""),
8968
+ greenBright: init("", ""),
8969
+ yellowBright: init("", ""),
8970
+ blueBright: init("", ""),
8971
+ magentaBright: init("", ""),
8972
+ cyanBright: init("", ""),
8973
+ whiteBright: init("", ""),
8974
+ bgBlackBright: init("", ""),
8975
+ bgRedBright: init("", ""),
8976
+ bgGreenBright: init("", ""),
8977
+ bgYellowBright: init("", ""),
8978
+ bgBlueBright: init("", ""),
8979
+ bgMagentaBright: init("", ""),
8980
+ bgCyanBright: init("", ""),
8981
+ bgWhiteBright: init("", ""),
8966
8982
  };
8967
8983
  };
8968
8984
  module.exports = createColors();
@@ -9164,7 +9180,7 @@
9164
9180
  "use strict";
9165
9181
  const fs = __nccwpck_require__(7147);
9166
9182
  const path = __nccwpck_require__(1017);
9167
- const { bold } = __nccwpck_require__(701);
9183
+ const { bold } = __nccwpck_require__(78);
9168
9184
  const Logger = __nccwpck_require__(1283);
9169
9185
  const viewer = __nccwpck_require__(7498);
9170
9186
  const utils = __nccwpck_require__(5554);
@@ -10506,7 +10522,7 @@
10506
10522
  const http = __nccwpck_require__(3685);
10507
10523
  const WebSocket = __nccwpck_require__(6057);
10508
10524
  const sirv = __nccwpck_require__(2486);
10509
- const { bold } = __nccwpck_require__(701);
10525
+ const { bold } = __nccwpck_require__(78);
10510
10526
  const Logger = __nccwpck_require__(1283);
10511
10527
  const analyzer = __nccwpck_require__(3377);
10512
10528
  const { open } = __nccwpck_require__(5554);
package/dist/index.cjs CHANGED
@@ -2297,7 +2297,7 @@ async function createContext(options, userConfig, bundlerType) {
2297
2297
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
2298
2298
  const cachePath = (0, import_node_path9.join)(rootPath, "node_modules", ".cache");
2299
2299
  return {
2300
- version: "1.0.1-rc.2",
2300
+ version: "1.0.1-rc.4",
2301
2301
  rootPath,
2302
2302
  distPath: "",
2303
2303
  cachePath,
@@ -3868,12 +3868,12 @@ var init_proxy = __esm({
3868
3868
  "use strict";
3869
3869
  init_logger();
3870
3870
  createProxyMiddleware = async (proxyOptions) => {
3871
- const formattedOptionsList = formatProxyOptions(proxyOptions);
3871
+ const formattedOptions = formatProxyOptions(proxyOptions);
3872
3872
  const proxyMiddlewares = [];
3873
3873
  const middlewares = [];
3874
- const { createProxyMiddleware: baseCreateProxyMiddleware } = await import("../compiled/http-proxy-middleware/index.js");
3875
- for (const opts of formattedOptionsList) {
3876
- const proxyMiddleware = baseCreateProxyMiddleware(opts.context, opts);
3874
+ const { createProxyMiddleware: baseMiddleware } = await import("../compiled/http-proxy-middleware/index.js");
3875
+ for (const opts of formattedOptions) {
3876
+ const proxyMiddleware = baseMiddleware(opts.context, opts);
3877
3877
  const middleware = async (req, res, next) => {
3878
3878
  const bypassUrl = typeof opts.bypass === "function" ? opts.bypass(req, res, opts) : null;
3879
3879
  if (bypassUrl === false) {
@@ -6031,9 +6031,9 @@ function applyExtensions({ chain }) {
6031
6031
  // most projects are using TypeScript, resolve .ts(x) files first to reduce resolve time.
6032
6032
  ".ts",
6033
6033
  ".tsx",
6034
+ ".mjs",
6034
6035
  ".js",
6035
6036
  ".jsx",
6036
- ".mjs",
6037
6037
  ".json"
6038
6038
  ];
6039
6039
  chain.resolve.extensions.merge(extensions);
@@ -6595,7 +6595,7 @@ var init_RsbuildHtmlPlugin = __esm({
6595
6595
  ...formatTags(data.headTags, { head: true }),
6596
6596
  ...formatTags(data.bodyTags, { head: false })
6597
6597
  ];
6598
- const utils = {
6598
+ const context = {
6599
6599
  hash: compilationHash,
6600
6600
  entryName,
6601
6601
  outputName: data.outputName,
@@ -6603,7 +6603,7 @@ var init_RsbuildHtmlPlugin = __esm({
6603
6603
  };
6604
6604
  for (const item of tagConfig.tags) {
6605
6605
  if (isFunction(item)) {
6606
- tags = item(tags, utils) || tags;
6606
+ tags = item(tags, context) || tags;
6607
6607
  } else {
6608
6608
  tags.push(item);
6609
6609
  }
@@ -8098,39 +8098,45 @@ var init_rsdoctor = __esm({
8098
8098
  return;
8099
8099
  }
8100
8100
  const isRspack = api.context.bundlerType === "rspack";
8101
+ const pluginName = isRspack ? "RsdoctorRspackPlugin" : "RsdoctorWebpackPlugin";
8102
+ const isRsdoctorPlugin = (plugin) => plugin?.isRsdoctorPlugin === true || plugin?.constructor?.name === pluginName;
8103
+ for (const config of bundlerConfigs) {
8104
+ const registered = config.plugins?.some(
8105
+ (plugin) => isRsdoctorPlugin(plugin)
8106
+ );
8107
+ if (registered) {
8108
+ return;
8109
+ }
8110
+ }
8101
8111
  const packageName = isRspack ? "@rsdoctor/rspack-plugin" : "@rsdoctor/webpack-plugin";
8102
- let module2;
8112
+ let packagePath;
8103
8113
  try {
8104
- const path20 = require.resolve(packageName, {
8114
+ packagePath = require.resolve(packageName, {
8105
8115
  paths: [api.context.rootPath]
8106
8116
  });
8107
- module2 = await import(path20);
8108
8117
  } catch (err) {
8109
8118
  import_rslog.logger.warn(
8110
8119
  `\`process.env.RSDOCTOR\` enabled, please install ${import_picocolors15.default.bold(import_picocolors15.default.yellow(packageName))} package.`
8111
8120
  );
8112
8121
  return;
8113
8122
  }
8114
- const pluginName = isRspack ? "RsdoctorRspackPlugin" : "RsdoctorWebpackPlugin";
8123
+ let module2;
8124
+ try {
8125
+ module2 = await import(packagePath);
8126
+ } catch (err) {
8127
+ import_rslog.logger.error(
8128
+ `\`process.env.RSDOCTOR\` enabled, but failed to load ${import_picocolors15.default.bold(import_picocolors15.default.yellow(packageName))} module.`
8129
+ );
8130
+ return;
8131
+ }
8115
8132
  if (!module2 || !module2[pluginName]) {
8116
8133
  return;
8117
8134
  }
8118
- let isAutoRegister = false;
8119
- const isRsdoctorPlugin = (plugin) => plugin?.isRsdoctorPlugin === true || plugin?.constructor?.name === pluginName;
8120
8135
  for (const config of bundlerConfigs) {
8121
- const registered = config.plugins?.some(
8122
- (plugin) => isRsdoctorPlugin(plugin)
8123
- );
8124
- if (registered) {
8125
- return;
8126
- }
8127
8136
  config.plugins ||= [];
8128
8137
  config.plugins.push(new module2[pluginName]());
8129
- isAutoRegister = true;
8130
- }
8131
- if (isAutoRegister) {
8132
- import_rslog.logger.info(`${import_picocolors15.default.bold(import_picocolors15.default.yellow(packageName))} enabled.`);
8133
8138
  }
8139
+ import_rslog.logger.info(`${import_picocolors15.default.bold(import_picocolors15.default.yellow(packageName))} enabled.`);
8134
8140
  });
8135
8141
  }
8136
8142
  });
@@ -9521,8 +9527,17 @@ async function createRsbuild(options = {}) {
9521
9527
  "createCompiler"
9522
9528
  ])
9523
9529
  };
9530
+ const getFlattenedPlugins = async (pluginOptions) => {
9531
+ let plugins = pluginOptions;
9532
+ do {
9533
+ plugins = (await Promise.all(plugins)).flat(
9534
+ Number.POSITIVE_INFINITY
9535
+ );
9536
+ } while (plugins.some((v) => (0, import_types3.isPromise)(v)));
9537
+ return plugins;
9538
+ };
9524
9539
  if (rsbuildConfig.plugins) {
9525
- const plugins = await Promise.all(rsbuildConfig.plugins);
9540
+ const plugins = await getFlattenedPlugins(rsbuildConfig.plugins);
9526
9541
  rsbuild.addPlugins(plugins);
9527
9542
  }
9528
9543
  if (rsbuildConfig.environments) {
@@ -9530,7 +9545,7 @@ async function createRsbuild(options = {}) {
9530
9545
  Object.entries(rsbuildConfig.environments).map(async ([name, config]) => {
9531
9546
  const isEnvironmentEnabled = !rsbuildOptions.environment || rsbuildOptions.environment.includes(name);
9532
9547
  if (config.plugins && isEnvironmentEnabled) {
9533
- const plugins = await Promise.all(config.plugins);
9548
+ const plugins = await getFlattenedPlugins(config.plugins);
9534
9549
  rsbuild.addPlugins(plugins, {
9535
9550
  environment: name
9536
9551
  });
@@ -9540,10 +9555,11 @@ async function createRsbuild(options = {}) {
9540
9555
  }
9541
9556
  return rsbuild;
9542
9557
  }
9543
- var getRspackProvider;
9558
+ var import_types3, getRspackProvider;
9544
9559
  var init_createRsbuild = __esm({
9545
9560
  "src/createRsbuild.ts"() {
9546
9561
  "use strict";
9562
+ import_types3 = require("util/types");
9547
9563
  init_createContext();
9548
9564
  init_helpers();
9549
9565
  init_initPlugins();
@@ -9652,7 +9668,7 @@ var init_init = __esm({
9652
9668
 
9653
9669
  // src/cli/commands.ts
9654
9670
  function runCli() {
9655
- import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.1-rc.2");
9671
+ import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.1-rc.4");
9656
9672
  const devCommand = import_commander.program.command("dev");
9657
9673
  const buildCommand = import_commander.program.command("build");
9658
9674
  const previewCommand = import_commander.program.command("preview");
@@ -9775,7 +9791,7 @@ function prepareCli() {
9775
9791
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9776
9792
  console.log();
9777
9793
  }
9778
- import_rslog.logger.greet(` ${`Rsbuild v${"1.0.1-rc.2"}`}
9794
+ import_rslog.logger.greet(` ${`Rsbuild v${"1.0.1-rc.4"}`}
9779
9795
  `);
9780
9796
  }
9781
9797
  var init_prepare = __esm({
@@ -9859,7 +9875,7 @@ init_logger();
9859
9875
  init_mergeConfig();
9860
9876
  init_helpers();
9861
9877
  init_constants();
9862
- var version = "1.0.1-rc.2";
9878
+ var version = "1.0.1-rc.4";
9863
9879
  // Annotate the CommonJS export names for ESM import in node:
9864
9880
  0 && (module.exports = {
9865
9881
  PLUGIN_CSS_NAME,
package/dist/index.js CHANGED
@@ -2335,7 +2335,7 @@ async function createContext(options, userConfig, bundlerType) {
2335
2335
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
2336
2336
  const cachePath = join6(rootPath, "node_modules", ".cache");
2337
2337
  return {
2338
- version: "1.0.1-rc.2",
2338
+ version: "1.0.1-rc.4",
2339
2339
  rootPath,
2340
2340
  distPath: "",
2341
2341
  cachePath,
@@ -3920,12 +3920,12 @@ var init_proxy = __esm({
3920
3920
  init_esm();
3921
3921
  init_logger();
3922
3922
  createProxyMiddleware = async (proxyOptions) => {
3923
- const formattedOptionsList = formatProxyOptions(proxyOptions);
3923
+ const formattedOptions = formatProxyOptions(proxyOptions);
3924
3924
  const proxyMiddlewares = [];
3925
3925
  const middlewares = [];
3926
- const { createProxyMiddleware: baseCreateProxyMiddleware } = await import("../compiled/http-proxy-middleware/index.js");
3927
- for (const opts of formattedOptionsList) {
3928
- const proxyMiddleware = baseCreateProxyMiddleware(opts.context, opts);
3926
+ const { createProxyMiddleware: baseMiddleware } = await import("../compiled/http-proxy-middleware/index.js");
3927
+ for (const opts of formattedOptions) {
3928
+ const proxyMiddleware = baseMiddleware(opts.context, opts);
3929
3929
  const middleware = async (req, res, next) => {
3930
3930
  const bypassUrl = typeof opts.bypass === "function" ? opts.bypass(req, res, opts) : null;
3931
3931
  if (bypassUrl === false) {
@@ -6101,9 +6101,9 @@ function applyExtensions({ chain }) {
6101
6101
  // most projects are using TypeScript, resolve .ts(x) files first to reduce resolve time.
6102
6102
  ".ts",
6103
6103
  ".tsx",
6104
+ ".mjs",
6104
6105
  ".js",
6105
6106
  ".jsx",
6106
- ".mjs",
6107
6107
  ".json"
6108
6108
  ];
6109
6109
  chain.resolve.extensions.merge(extensions);
@@ -6670,7 +6670,7 @@ var init_RsbuildHtmlPlugin = __esm({
6670
6670
  ...formatTags(data.headTags, { head: true }),
6671
6671
  ...formatTags(data.bodyTags, { head: false })
6672
6672
  ];
6673
- const utils = {
6673
+ const context = {
6674
6674
  hash: compilationHash,
6675
6675
  entryName,
6676
6676
  outputName: data.outputName,
@@ -6678,7 +6678,7 @@ var init_RsbuildHtmlPlugin = __esm({
6678
6678
  };
6679
6679
  for (const item of tagConfig.tags) {
6680
6680
  if (isFunction(item)) {
6681
- tags = item(tags, utils) || tags;
6681
+ tags = item(tags, context) || tags;
6682
6682
  } else {
6683
6683
  tags.push(item);
6684
6684
  }
@@ -8186,39 +8186,45 @@ var init_rsdoctor = __esm({
8186
8186
  return;
8187
8187
  }
8188
8188
  const isRspack = api.context.bundlerType === "rspack";
8189
+ const pluginName = isRspack ? "RsdoctorRspackPlugin" : "RsdoctorWebpackPlugin";
8190
+ const isRsdoctorPlugin = (plugin) => plugin?.isRsdoctorPlugin === true || plugin?.constructor?.name === pluginName;
8191
+ for (const config of bundlerConfigs) {
8192
+ const registered = config.plugins?.some(
8193
+ (plugin) => isRsdoctorPlugin(plugin)
8194
+ );
8195
+ if (registered) {
8196
+ return;
8197
+ }
8198
+ }
8189
8199
  const packageName = isRspack ? "@rsdoctor/rspack-plugin" : "@rsdoctor/webpack-plugin";
8190
- let module;
8200
+ let packagePath;
8191
8201
  try {
8192
- const path21 = __require.resolve(packageName, {
8202
+ packagePath = __require.resolve(packageName, {
8193
8203
  paths: [api.context.rootPath]
8194
8204
  });
8195
- module = await import(path21);
8196
8205
  } catch (err) {
8197
8206
  logger.warn(
8198
8207
  `\`process.env.RSDOCTOR\` enabled, please install ${color15.bold(color15.yellow(packageName))} package.`
8199
8208
  );
8200
8209
  return;
8201
8210
  }
8202
- const pluginName = isRspack ? "RsdoctorRspackPlugin" : "RsdoctorWebpackPlugin";
8211
+ let module;
8212
+ try {
8213
+ module = await import(packagePath);
8214
+ } catch (err) {
8215
+ logger.error(
8216
+ `\`process.env.RSDOCTOR\` enabled, but failed to load ${color15.bold(color15.yellow(packageName))} module.`
8217
+ );
8218
+ return;
8219
+ }
8203
8220
  if (!module || !module[pluginName]) {
8204
8221
  return;
8205
8222
  }
8206
- let isAutoRegister = false;
8207
- const isRsdoctorPlugin = (plugin) => plugin?.isRsdoctorPlugin === true || plugin?.constructor?.name === pluginName;
8208
8223
  for (const config of bundlerConfigs) {
8209
- const registered = config.plugins?.some(
8210
- (plugin) => isRsdoctorPlugin(plugin)
8211
- );
8212
- if (registered) {
8213
- return;
8214
- }
8215
8224
  config.plugins ||= [];
8216
8225
  config.plugins.push(new module[pluginName]());
8217
- isAutoRegister = true;
8218
- }
8219
- if (isAutoRegister) {
8220
- logger.info(`${color15.bold(color15.yellow(packageName))} enabled.`);
8221
8226
  }
8227
+ logger.info(`${color15.bold(color15.yellow(packageName))} enabled.`);
8222
8228
  });
8223
8229
  }
8224
8230
  });
@@ -9470,6 +9476,7 @@ var createRsbuild_exports = {};
9470
9476
  __export(createRsbuild_exports, {
9471
9477
  createRsbuild: () => createRsbuild
9472
9478
  });
9479
+ import { isPromise } from "util/types";
9473
9480
  async function applyDefaultPlugins(pluginManager, context) {
9474
9481
  const plugins = await Promise.all([
9475
9482
  Promise.resolve().then(() => (init_basic2(), basic_exports)).then(({ pluginBasic: pluginBasic2 }) => pluginBasic2()),
@@ -9625,8 +9632,17 @@ async function createRsbuild(options = {}) {
9625
9632
  "createCompiler"
9626
9633
  ])
9627
9634
  };
9635
+ const getFlattenedPlugins = async (pluginOptions) => {
9636
+ let plugins = pluginOptions;
9637
+ do {
9638
+ plugins = (await Promise.all(plugins)).flat(
9639
+ Number.POSITIVE_INFINITY
9640
+ );
9641
+ } while (plugins.some((v) => isPromise(v)));
9642
+ return plugins;
9643
+ };
9628
9644
  if (rsbuildConfig.plugins) {
9629
- const plugins = await Promise.all(rsbuildConfig.plugins);
9645
+ const plugins = await getFlattenedPlugins(rsbuildConfig.plugins);
9630
9646
  rsbuild.addPlugins(plugins);
9631
9647
  }
9632
9648
  if (rsbuildConfig.environments) {
@@ -9634,7 +9650,7 @@ async function createRsbuild(options = {}) {
9634
9650
  Object.entries(rsbuildConfig.environments).map(async ([name, config]) => {
9635
9651
  const isEnvironmentEnabled = !rsbuildOptions.environment || rsbuildOptions.environment.includes(name);
9636
9652
  if (config.plugins && isEnvironmentEnabled) {
9637
- const plugins = await Promise.all(config.plugins);
9653
+ const plugins = await getFlattenedPlugins(config.plugins);
9638
9654
  rsbuild.addPlugins(plugins, {
9639
9655
  environment: name
9640
9656
  });
@@ -9761,7 +9777,7 @@ import { existsSync } from "fs";
9761
9777
  import { program } from "../compiled/commander/index.js";
9762
9778
  import color16 from "../compiled/picocolors/index.js";
9763
9779
  function runCli() {
9764
- program.name("rsbuild").usage("<command> [options]").version("1.0.1-rc.2");
9780
+ program.name("rsbuild").usage("<command> [options]").version("1.0.1-rc.4");
9765
9781
  const devCommand = program.command("dev");
9766
9782
  const buildCommand = program.command("build");
9767
9783
  const previewCommand = program.command("preview");
@@ -9882,7 +9898,7 @@ function prepareCli() {
9882
9898
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9883
9899
  console.log();
9884
9900
  }
9885
- logger.greet(` ${`Rsbuild v${"1.0.1-rc.2"}`}
9901
+ logger.greet(` ${`Rsbuild v${"1.0.1-rc.4"}`}
9886
9902
  `);
9887
9903
  }
9888
9904
  var init_prepare = __esm({
@@ -9953,7 +9969,7 @@ init_mergeConfig();
9953
9969
  init_helpers();
9954
9970
  init_constants();
9955
9971
  import { rspack as rspack10 } from "@rspack/core";
9956
- var version = "1.0.1-rc.2";
9972
+ var version = "1.0.1-rc.4";
9957
9973
  export {
9958
9974
  PLUGIN_CSS_NAME,
9959
9975
  PLUGIN_SWC_NAME,
@@ -15,7 +15,7 @@ export { logger } from './logger';
15
15
  export { mergeRsbuildConfig } from './mergeConfig';
16
16
  export { ensureAssetPrefix } from './helpers';
17
17
  export { PLUGIN_SWC_NAME, PLUGIN_CSS_NAME } from './constants';
18
- export type { AppIcon, AppIconItem, AliasStrategy, Build, BuildOptions, BundlerPluginInstance, CacheGroup, CacheGroups, ClientConfig, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateCompilerOptions, CreateRsbuildOptions, ResolvedCreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, Decorators, DevConfig, DistPathConfig, EnvironmentContext, EnvironmentConfig, FilenameConfig, HtmlConfig, HtmlRspackPlugin, HtmlBasicTag, HtmlTagHandler, HtmlTagDescriptor, InspectConfigOptions, InspectConfigResult, LegalComments, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyRsbuildConfigFn, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigUtils, ModuleFederationConfig, MergedEnvironmentConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSPlugin, PreconnectOption, PrintUrls, PublicDir, PublicDirOptions, RequestHandler, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerAPIs, ServerConfig, SourceConfig, SplitChunks, StyleLoaderOptions, ToolsConfig, TransformFn, TransformHandler, TransformImport, WatchFiles, } from './types';
18
+ export type { AppIcon, AppIconItem, AliasStrategy, Build, BuildOptions, BundlerPluginInstance, CacheGroup, CacheGroups, Charset, ClientConfig, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateCompilerOptions, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentContext, EnvironmentConfig, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlConfig, HtmlRspackPlugin, HtmlBasicTag, HtmlFallback, HtmlTagHandler, HtmlTagDescriptor, HtmlTagContext, InspectConfigOptions, InspectConfigResult, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, LegalComments, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyRsbuildConfigFn, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigUtils, ModuleFederationConfig, MergedEnvironmentConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSPlugin, PreconnectOption, ProxyConfig, ProxyOptions, PrintUrls, PublicDir, PublicDirOptions, ProgressBarConfig, RequestHandler, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildTarget, RspackChain, RspackRule, SriOptions, SriAlgorithm, ScriptInject, ScriptLoading, SecurityConfig, SourceMap, SetupMiddlewaresFn, SetupMiddlewaresServer, ServerConfig, SourceConfig, SplitChunks, StyleLoaderOptions, ToolsConfig, TransformFn, TransformHandler, TransformImport, WatchFiles, } from './types';
19
19
  export type { ChainIdentifier } from './configChain';
20
20
  export {
21
21
  /**
@@ -1,8 +1,8 @@
1
- import type { DevConfig, EnvironmentAPI, RequestHandler, Rspack, ServerAPIs, ServerConfig } from '../types';
1
+ import type { DevConfig, EnvironmentAPI, RequestHandler, Rspack, ServerConfig, SetupMiddlewaresServer } from '../types';
2
2
  import type { UpgradeEvent } from './helper';
3
3
  export type CompileMiddlewareAPI = {
4
4
  middleware: RequestHandler;
5
- sockWrite: ServerAPIs['sockWrite'];
5
+ sockWrite: SetupMiddlewaresServer['sockWrite'];
6
6
  onUpgrade: UpgradeEvent;
7
7
  close: () => void;
8
8
  };
@@ -1,6 +1,6 @@
1
- import type { RequestHandler as Middleware, ProxyOptions } from '../types';
1
+ import type { RequestHandler as Middleware, ProxyConfig } from '../types';
2
2
  import type { UpgradeEvent } from './helper';
3
- export declare const createProxyMiddleware: (proxyOptions: ProxyOptions) => Promise<{
3
+ export declare const createProxyMiddleware: (proxyOptions: ProxyConfig) => Promise<{
4
4
  middlewares: Middleware[];
5
5
  upgrade: UpgradeEvent;
6
6
  }>;
@@ -3,7 +3,7 @@ import type { SecureServerSessionOptions } from 'node:http2';
3
3
  import type { ServerOptions as HttpsServerOptions } from 'node:https';
4
4
  import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions, rspack } from '@rspack/core';
5
5
  import type { WatchOptions } from '../../compiled/chokidar';
6
- import type { Options as BaseProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
6
+ import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
7
7
  import type RspackChain from '../../compiled/rspack-chain';
8
8
  import type { BundleAnalyzerPlugin } from '../../compiled/webpack-bundle-analyzer';
9
9
  import type { ModifyBundlerChainUtils, ModifyChainUtils, Routes } from './hooks';
@@ -163,11 +163,22 @@ export interface NormalizedSourceConfig extends SourceConfig {
163
163
  decorators: Required<Decorators>;
164
164
  }
165
165
  export type HtmlFallback = false | 'index';
166
- export type ProxyDetail = BaseProxyOptions & {
167
- bypass?: (req: IncomingMessage, res: ServerResponse, proxyOptions: ProxyOptions) => string | undefined | null | boolean;
166
+ export type ProxyBypass = (req: IncomingMessage, res: ServerResponse, proxyOptions: ProxyOptions) => string | undefined | null | boolean;
167
+ export type ProxyOptions = HttpProxyOptions & {
168
+ /**
169
+ * Bypass the proxy based on the return value of a function.
170
+ * - Return `null` or `undefined` to continue processing the request with proxy.
171
+ * - Return `true` to continue processing the request without proxy.
172
+ * - Return `false` to produce a 404 error for the request.
173
+ * - Return a path to serve from, instead of continuing to proxy the request.
174
+ */
175
+ bypass?: ProxyBypass;
176
+ /**
177
+ * Used to proxy multiple specified paths to the same target.
178
+ */
168
179
  context?: ProxyFilter;
169
180
  };
170
- export type ProxyOptions = Record<string, string> | Record<string, ProxyDetail> | ProxyDetail[] | ProxyDetail;
181
+ export type ProxyConfig = Record<string, string> | Record<string, ProxyOptions> | ProxyOptions[] | ProxyOptions;
171
182
  export type HistoryApiFallbackContext = {
172
183
  match: RegExpMatchArray;
173
184
  parsedUrl: import('node:url').Url;
@@ -252,7 +263,7 @@ export interface ServerConfig {
252
263
  /**
253
264
  * Configure proxy rules for the dev server or preview server to proxy requests to the specified service.
254
265
  */
255
- proxy?: ProxyOptions;
266
+ proxy?: ProxyConfig;
256
267
  /**
257
268
  * Whether to throw an error when the port is occupied.
258
269
  */
@@ -734,13 +745,13 @@ export type HtmlTag = HtmlBasicTag & {
734
745
  append?: boolean;
735
746
  head?: boolean;
736
747
  };
737
- export type HtmlTagUtils = {
748
+ export type HtmlTagContext = {
738
749
  hash: string;
739
750
  entryName: string;
740
751
  outputName: string;
741
752
  publicPath: string;
742
753
  };
743
- export type HtmlTagHandler = (tags: HtmlTag[], utils: HtmlTagUtils) => HtmlTag[] | void;
754
+ export type HtmlTagHandler = (tags: HtmlTag[], context: HtmlTagContext) => HtmlTag[] | void;
744
755
  export type HtmlTagDescriptor = HtmlTag | HtmlTagHandler;
745
756
  type ChainedHtmlOption<O> = ConfigChainMergeContext<O, {
746
757
  entryName: string;
@@ -875,10 +886,14 @@ export type EnvironmentAPI = {
875
886
  getTransformedHtml: (entryName: string) => Promise<string>;
876
887
  };
877
888
  };
878
- export type ServerAPIs = {
889
+ export type SetupMiddlewaresServer = {
879
890
  sockWrite: (type: string, data?: string | boolean | Record<string, any>) => void;
880
891
  environments: EnvironmentAPI;
881
892
  };
893
+ export type SetupMiddlewaresFn = (middlewares: {
894
+ unshift: (...handlers: RequestHandler[]) => void;
895
+ push: (...handlers: RequestHandler[]) => void;
896
+ }, server: SetupMiddlewaresServer) => void;
882
897
  export type ClientConfig = {
883
898
  /**
884
899
  * The path for the WebSocket request.
@@ -943,14 +958,7 @@ export interface DevConfig {
943
958
  /**
944
959
  * Provides the ability to execute a custom function and apply custom middlewares.
945
960
  */
946
- setupMiddlewares?: Array<(
947
- /** Order: `unshift` => internal middlewares => `push` */
948
- middlewares: {
949
- /** Use the `unshift` method if you want to run a middleware before all other middlewares */
950
- unshift: (...handlers: RequestHandler[]) => void;
951
- /** Use the `push` method if you want to run a middleware after all other middlewares */
952
- push: (...handlers: RequestHandler[]) => void;
953
- }, server: ServerAPIs) => void>;
961
+ setupMiddlewares?: SetupMiddlewaresFn[];
954
962
  /**
955
963
  * Controls whether the build output from development mode is written to disk.
956
964
  * @default false
@@ -129,7 +129,7 @@ export type RsbuildPlugin = {
129
129
  type LooseRsbuildPlugin = Omit<RsbuildPlugin, 'setup'> & {
130
130
  setup: (api: any) => MaybePromise<void>;
131
131
  };
132
- export type RsbuildPlugins = (LooseRsbuildPlugin | Falsy | Promise<LooseRsbuildPlugin | Falsy>)[];
132
+ export type RsbuildPlugins = (LooseRsbuildPlugin | Falsy | Promise<LooseRsbuildPlugin | Falsy | RsbuildPlugins> | RsbuildPlugins)[];
133
133
  export type GetRsbuildConfig = {
134
134
  (): Readonly<RsbuildConfig>;
135
135
  (type: 'original' | 'current'): Readonly<RsbuildConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.0.1-rc.2",
3
+ "version": "1.0.1-rc.4",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,8 +46,8 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.0.0",
50
- "@rspack/lite-tapable": "1.0.0",
49
+ "@rspack/core": "~1.0.3",
50
+ "@rspack/lite-tapable": "~1.0.0",
51
51
  "@swc/helpers": "^0.5.12",
52
52
  "caniuse-lite": "^1.0.30001655",
53
53
  "core-js": "~3.38.1"
@@ -77,7 +77,7 @@
77
77
  "mrmime": "^2.0.0",
78
78
  "on-finished": "2.4.1",
79
79
  "open": "^8.4.0",
80
- "picocolors": "^1.0.1",
80
+ "picocolors": "^1.1.0",
81
81
  "postcss": "^8.4.43",
82
82
  "postcss-load-config": "6.0.1",
83
83
  "postcss-loader": "8.1.1",