@rsbuild/core 1.0.16 → 1.0.17

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
- 2358: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 6754: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(536);
5
+ const loader = __nccwpck_require__(7386);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(9166).defaultGetLocalIdent;
8
+ __nccwpck_require__(3004).defaultGetLocalIdent;
9
9
  },
10
- 536: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 7386: (__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__(3360));
16
16
  var _semver = { satisfies: () => true };
17
- var _options = _interopRequireDefault(__nccwpck_require__(2438));
18
- var _plugins = __nccwpck_require__(9490);
19
- var _utils = __nccwpck_require__(9166);
17
+ var _options = _interopRequireDefault(__nccwpck_require__(3087));
18
+ var _plugins = __nccwpck_require__(4077);
19
+ var _utils = __nccwpck_require__(3004);
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
- 9490: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 4077: (__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__(2782),
268
+ __nccwpck_require__(1252),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(1885),
271
+ __nccwpck_require__(3170),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4908));
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4706));
274
274
  function _interopRequireDefault(obj) {
275
275
  return obj && obj.__esModule ? obj : { default: obj };
276
276
  }
277
277
  },
278
- 1885: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 3170: (__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__(8406);
283
- var _utils = __nccwpck_require__(9166);
283
+ var _utils = __nccwpck_require__(3004);
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
- 2782: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 1252: (__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__(9166);
389
+ var _utils = __nccwpck_require__(3004);
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
- 4908: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 4706: (__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__(9166);
701
+ var _utils = __nccwpck_require__(3004);
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
- 9166: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 3004: (__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;
@@ -7960,7 +7960,7 @@
7960
7960
  "use strict";
7961
7961
  module.exports = require("util");
7962
7962
  },
7963
- 2438: (module) => {
7963
+ 3087: (module) => {
7964
7964
  "use strict";
7965
7965
  module.exports = JSON.parse(
7966
7966
  '{"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"}',
@@ -7995,6 +7995,6 @@
7995
7995
  }
7996
7996
  if (typeof __nccwpck_require__ !== "undefined")
7997
7997
  __nccwpck_require__.ab = __dirname + "/";
7998
- var __webpack_exports__ = __nccwpck_require__(2358);
7998
+ var __webpack_exports__ = __nccwpck_require__(6754);
7999
7999
  module.exports = __webpack_exports__;
8000
8000
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 825: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 909: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(201);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(903);
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
- 201: (module) => {
307
+ 903: (module) => {
308
308
  "use strict";
309
309
  class HtmlWebpackChildCompiler {
310
310
  constructor(templates) {
@@ -473,7 +473,7 @@
473
473
  }
474
474
  module.exports = { HtmlWebpackChildCompiler };
475
475
  },
476
- 928: (module) => {
476
+ 78: (module) => {
477
477
  "use strict";
478
478
  module.exports = {};
479
479
  module.exports.none = (chunks) => chunks;
@@ -492,7 +492,7 @@
492
492
  };
493
493
  module.exports.auto = module.exports.none;
494
494
  },
495
- 627: (module) => {
495
+ 422: (module) => {
496
496
  "use strict";
497
497
  module.exports = function (err) {
498
498
  return {
@@ -513,7 +513,7 @@
513
513
  };
514
514
  };
515
515
  },
516
- 766: (module, __unused_webpack_exports, __nccwpck_require__) => {
516
+ 9: (module, __unused_webpack_exports, __nccwpck_require__) => {
517
517
  "use strict";
518
518
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(348);
519
519
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -539,7 +539,7 @@
539
539
  }
540
540
  module.exports = { getHtmlRspackPluginHooks };
541
541
  },
542
- 217: (module) => {
542
+ 301: (module) => {
543
543
  const voidTags = [
544
544
  "area",
545
545
  "base",
@@ -607,19 +607,19 @@
607
607
  htmlTagObjectToString,
608
608
  };
609
609
  },
610
- 175: (module, __unused_webpack_exports, __nccwpck_require__) => {
610
+ 541: (module, __unused_webpack_exports, __nccwpck_require__) => {
611
611
  "use strict";
612
612
  const promisify = __nccwpck_require__(837).promisify;
613
613
  const vm = __nccwpck_require__(144);
614
614
  const fs = __nccwpck_require__(147);
615
615
  const path = __nccwpck_require__(17);
616
- const { CachedChildCompilation } = __nccwpck_require__(825);
616
+ const { CachedChildCompilation } = __nccwpck_require__(909);
617
617
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
618
- __nccwpck_require__(217);
619
- const prettyError = __nccwpck_require__(627);
620
- const chunkSorter = __nccwpck_require__(928);
618
+ __nccwpck_require__(301);
619
+ const prettyError = __nccwpck_require__(422);
620
+ const chunkSorter = __nccwpck_require__(78);
621
621
  const getHtmlRspackPluginHooks =
622
- __nccwpck_require__(766).getHtmlRspackPluginHooks;
622
+ __nccwpck_require__(9).getHtmlRspackPluginHooks;
623
623
  class HtmlRspackPlugin {
624
624
  constructor(userOptions = {}) {
625
625
  this.version = HtmlRspackPlugin.version;
@@ -1578,6 +1578,6 @@
1578
1578
  }
1579
1579
  if (typeof __nccwpck_require__ !== "undefined")
1580
1580
  __nccwpck_require__.ab = __dirname + "/";
1581
- var __webpack_exports__ = __nccwpck_require__(175);
1581
+ var __webpack_exports__ = __nccwpck_require__(541);
1582
1582
  module.exports = __webpack_exports__;
1583
1583
  })();
@@ -2,7 +2,7 @@ type Formatter = (input: string | number | null | undefined) => string
2
2
 
3
3
  interface Colors {
4
4
  isColorSupported: boolean
5
-
5
+
6
6
  reset: Formatter
7
7
  bold: Formatter
8
8
  dim: Formatter
@@ -11,7 +11,7 @@ interface Colors {
11
11
  inverse: Formatter
12
12
  hidden: Formatter
13
13
  strikethrough: Formatter
14
-
14
+
15
15
  black: Formatter
16
16
  red: Formatter
17
17
  green: Formatter
@@ -21,7 +21,7 @@ interface Colors {
21
21
  cyan: Formatter
22
22
  white: Formatter
23
23
  gray: Formatter
24
-
24
+
25
25
  bgBlack: Formatter
26
26
  bgRed: Formatter
27
27
  bgGreen: Formatter
@@ -32,23 +32,22 @@ interface Colors {
32
32
  bgWhite: Formatter
33
33
 
34
34
  blackBright: Formatter
35
- redBright: Formatter
36
- greenBright: Formatter
37
- yellowBright: Formatter
38
- blueBright: Formatter
39
- magentaBright: Formatter
40
- cyanBright: Formatter
41
- whiteBright: Formatter
35
+ redBright: Formatter
36
+ greenBright: Formatter
37
+ yellowBright: Formatter
38
+ blueBright: Formatter
39
+ magentaBright: Formatter
40
+ cyanBright: Formatter
41
+ whiteBright: Formatter
42
42
 
43
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
-
44
+ bgRedBright: Formatter
45
+ bgGreenBright: Formatter
46
+ bgYellowBright: Formatter
47
+ bgBlueBright: Formatter
48
+ bgMagentaBright: Formatter
49
+ bgCyanBright: Formatter
50
+ bgWhiteBright: Formatter
52
51
  }
53
52
 
54
53
  declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
@@ -1,29 +1,28 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 78: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
- let argv = process.argv || [],
5
- env = process.env;
3
+ 209: (module) => {
4
+ let p = process || {},
5
+ argv = p.argv || [],
6
+ env = p.env || {};
6
7
  let isColorSupported =
7
- !("NO_COLOR" in env || argv.includes("--no-color")) &&
8
- ("FORCE_COLOR" in env ||
8
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
9
+ (!!env.FORCE_COLOR ||
9
10
  argv.includes("--color") ||
10
- process.platform === "win32" ||
11
- (require != null &&
12
- __nccwpck_require__(224).isatty(1) &&
13
- env.TERM !== "dumb") ||
14
- "CI" in env);
11
+ p.platform === "win32" ||
12
+ ((p.stdout || {}).isTTY && env.TERM !== "dumb") ||
13
+ !!env.CI);
15
14
  let formatter =
16
15
  (open, close, replace = open) =>
17
16
  (input) => {
18
- let string = "" + input;
19
- let index = string.indexOf(close, open.length);
17
+ let string = "" + input,
18
+ index = string.indexOf(close, open.length);
20
19
  return ~index
21
20
  ? open + replaceClose(string, close, replace, index) + close
22
21
  : open + string + close;
23
22
  };
24
23
  let replaceClose = (string, close, replace, index) => {
25
- let result = "";
26
- let cursor = 0;
24
+ let result = "",
25
+ cursor = 0;
27
26
  do {
28
27
  result += string.substring(cursor, index) + replace;
29
28
  cursor = index + close.length;
@@ -32,59 +31,55 @@
32
31
  return result + string.substring(cursor);
33
32
  };
34
33
  let createColors = (enabled = isColorSupported) => {
35
- let init = enabled ? formatter : () => String;
34
+ let f = enabled ? formatter : () => String;
36
35
  return {
37
36
  isColorSupported: enabled,
38
- reset: init("", ""),
39
- bold: init("", "", ""),
40
- dim: init("", "", ""),
41
- italic: init("", ""),
42
- underline: init("", ""),
43
- inverse: init("", ""),
44
- hidden: init("", ""),
45
- strikethrough: init("", ""),
46
- black: init("", ""),
47
- red: init("", ""),
48
- green: init("", ""),
49
- yellow: init("", ""),
50
- blue: init("", ""),
51
- magenta: init("", ""),
52
- cyan: init("", ""),
53
- white: init("", ""),
54
- gray: init("", ""),
55
- bgBlack: init("", ""),
56
- bgRed: init("", ""),
57
- bgGreen: init("", ""),
58
- bgYellow: init("", ""),
59
- bgBlue: init("", ""),
60
- bgMagenta: init("", ""),
61
- bgCyan: init("", ""),
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("", ""),
37
+ reset: f("", ""),
38
+ bold: f("", "", ""),
39
+ dim: f("", "", ""),
40
+ italic: f("", ""),
41
+ underline: f("", ""),
42
+ inverse: f("", ""),
43
+ hidden: f("", ""),
44
+ strikethrough: f("", ""),
45
+ black: f("", ""),
46
+ red: f("", ""),
47
+ green: f("", ""),
48
+ yellow: f("", ""),
49
+ blue: f("", ""),
50
+ magenta: f("", ""),
51
+ cyan: f("", ""),
52
+ white: f("", ""),
53
+ gray: f("", ""),
54
+ bgBlack: f("", ""),
55
+ bgRed: f("", ""),
56
+ bgGreen: f("", ""),
57
+ bgYellow: f("", ""),
58
+ bgBlue: f("", ""),
59
+ bgMagenta: f("", ""),
60
+ bgCyan: f("", ""),
61
+ bgWhite: f("", ""),
62
+ blackBright: f("", ""),
63
+ redBright: f("", ""),
64
+ greenBright: f("", ""),
65
+ yellowBright: f("", ""),
66
+ blueBright: f("", ""),
67
+ magentaBright: f("", ""),
68
+ cyanBright: f("", ""),
69
+ whiteBright: f("", ""),
70
+ bgBlackBright: f("", ""),
71
+ bgRedBright: f("", ""),
72
+ bgGreenBright: f("", ""),
73
+ bgYellowBright: f("", ""),
74
+ bgBlueBright: f("", ""),
75
+ bgMagentaBright: f("", ""),
76
+ bgCyanBright: f("", ""),
77
+ bgWhiteBright: f("", ""),
79
78
  };
80
79
  };
81
80
  module.exports = createColors();
82
81
  module.exports.createColors = createColors;
83
82
  },
84
- 224: (module) => {
85
- "use strict";
86
- module.exports = require("tty");
87
- },
88
83
  };
89
84
  var __webpack_module_cache__ = {};
90
85
  function __nccwpck_require__(moduleId) {
@@ -108,6 +103,6 @@
108
103
  }
109
104
  if (typeof __nccwpck_require__ !== "undefined")
110
105
  __nccwpck_require__.ab = __dirname + "/";
111
- var __webpack_exports__ = __nccwpck_require__(78);
106
+ var __webpack_exports__ = __nccwpck_require__(209);
112
107
  module.exports = __webpack_exports__;
113
108
  })();
@@ -1 +1 @@
1
- {"name":"picocolors","author":"Alexey Raspopov","version":"1.1.0","license":"ISC","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"picocolors","author":"Alexey Raspopov","version":"1.1.1","license":"ISC","types":"index.d.ts","type":"commonjs"}
@@ -1,17 +1,17 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 533: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(646)["default"];
4
+ 777: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(779)["default"];
6
6
  },
7
- 646: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 779: (__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__(360));
13
- var _options = _interopRequireDefault(__nccwpck_require__(839));
14
- var _utils = __nccwpck_require__(107);
13
+ var _options = _interopRequireDefault(__nccwpck_require__(723));
14
+ var _utils = __nccwpck_require__(974);
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
- 107: (module, exports, __nccwpck_require__) => {
192
+ 974: (module, exports, __nccwpck_require__) => {
193
193
  module = __nccwpck_require__.nmd(module);
194
194
  Object.defineProperty(exports, "__esModule", { value: true });
195
195
  exports.exec = exec;
@@ -691,7 +691,7 @@
691
691
  310: (module) => {
692
692
  module.exports = require("url");
693
693
  },
694
- 839: (module) => {
694
+ 723: (module) => {
695
695
  module.exports = JSON.parse(
696
696
  '{"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}',
697
697
  );
@@ -736,6 +736,6 @@
736
736
  })();
737
737
  if (typeof __nccwpck_require__ !== "undefined")
738
738
  __nccwpck_require__.ab = __dirname + "/";
739
- var __webpack_exports__ = __nccwpck_require__(533);
739
+ var __webpack_exports__ = __nccwpck_require__(777);
740
740
  module.exports = __webpack_exports__;
741
741
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 376: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 248: (__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
- 317: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 458: (__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__(376);
133
+ const helpers_1 = __nccwpck_require__(248);
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__(317);
315
+ const hooks_1 = __nccwpck_require__(458);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
@@ -8903,30 +8903,29 @@
8903
8903
  return childProcess.execFile(command, args, options, callback);
8904
8904
  };
8905
8905
  },
8906
- 78: (module, __unused_webpack_exports, __nccwpck_require__) => {
8907
- let argv = process.argv || [],
8908
- env = process.env;
8906
+ 5209: (module) => {
8907
+ let p = process || {},
8908
+ argv = p.argv || [],
8909
+ env = p.env || {};
8909
8910
  let isColorSupported =
8910
- !("NO_COLOR" in env || argv.includes("--no-color")) &&
8911
- ("FORCE_COLOR" in env ||
8911
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
8912
+ (!!env.FORCE_COLOR ||
8912
8913
  argv.includes("--color") ||
8913
- process.platform === "win32" ||
8914
- (require != null &&
8915
- __nccwpck_require__(6224).isatty(1) &&
8916
- env.TERM !== "dumb") ||
8917
- "CI" in env);
8914
+ p.platform === "win32" ||
8915
+ ((p.stdout || {}).isTTY && env.TERM !== "dumb") ||
8916
+ !!env.CI);
8918
8917
  let formatter =
8919
8918
  (open, close, replace = open) =>
8920
8919
  (input) => {
8921
- let string = "" + input;
8922
- let index = string.indexOf(close, open.length);
8920
+ let string = "" + input,
8921
+ index = string.indexOf(close, open.length);
8923
8922
  return ~index
8924
8923
  ? open + replaceClose(string, close, replace, index) + close
8925
8924
  : open + string + close;
8926
8925
  };
8927
8926
  let replaceClose = (string, close, replace, index) => {
8928
- let result = "";
8929
- let cursor = 0;
8927
+ let result = "",
8928
+ cursor = 0;
8930
8929
  do {
8931
8930
  result += string.substring(cursor, index) + replace;
8932
8931
  cursor = index + close.length;
@@ -8935,50 +8934,50 @@
8935
8934
  return result + string.substring(cursor);
8936
8935
  };
8937
8936
  let createColors = (enabled = isColorSupported) => {
8938
- let init = enabled ? formatter : () => String;
8937
+ let f = enabled ? formatter : () => String;
8939
8938
  return {
8940
8939
  isColorSupported: enabled,
8941
- reset: init("", ""),
8942
- bold: init("", "", ""),
8943
- dim: init("", "", ""),
8944
- italic: init("", ""),
8945
- underline: init("", ""),
8946
- inverse: init("", ""),
8947
- hidden: init("", ""),
8948
- strikethrough: init("", ""),
8949
- black: init("", ""),
8950
- red: init("", ""),
8951
- green: init("", ""),
8952
- yellow: init("", ""),
8953
- blue: init("", ""),
8954
- magenta: init("", ""),
8955
- cyan: init("", ""),
8956
- white: init("", ""),
8957
- gray: init("", ""),
8958
- bgBlack: init("", ""),
8959
- bgRed: init("", ""),
8960
- bgGreen: init("", ""),
8961
- bgYellow: init("", ""),
8962
- bgBlue: init("", ""),
8963
- bgMagenta: init("", ""),
8964
- bgCyan: init("", ""),
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("", ""),
8940
+ reset: f("", ""),
8941
+ bold: f("", "", ""),
8942
+ dim: f("", "", ""),
8943
+ italic: f("", ""),
8944
+ underline: f("", ""),
8945
+ inverse: f("", ""),
8946
+ hidden: f("", ""),
8947
+ strikethrough: f("", ""),
8948
+ black: f("", ""),
8949
+ red: f("", ""),
8950
+ green: f("", ""),
8951
+ yellow: f("", ""),
8952
+ blue: f("", ""),
8953
+ magenta: f("", ""),
8954
+ cyan: f("", ""),
8955
+ white: f("", ""),
8956
+ gray: f("", ""),
8957
+ bgBlack: f("", ""),
8958
+ bgRed: f("", ""),
8959
+ bgGreen: f("", ""),
8960
+ bgYellow: f("", ""),
8961
+ bgBlue: f("", ""),
8962
+ bgMagenta: f("", ""),
8963
+ bgCyan: f("", ""),
8964
+ bgWhite: f("", ""),
8965
+ blackBright: f("", ""),
8966
+ redBright: f("", ""),
8967
+ greenBright: f("", ""),
8968
+ yellowBright: f("", ""),
8969
+ blueBright: f("", ""),
8970
+ magentaBright: f("", ""),
8971
+ cyanBright: f("", ""),
8972
+ whiteBright: f("", ""),
8973
+ bgBlackBright: f("", ""),
8974
+ bgRedBright: f("", ""),
8975
+ bgGreenBright: f("", ""),
8976
+ bgYellowBright: f("", ""),
8977
+ bgBlueBright: f("", ""),
8978
+ bgMagentaBright: f("", ""),
8979
+ bgCyanBright: f("", ""),
8980
+ bgWhiteBright: f("", ""),
8982
8981
  };
8983
8982
  };
8984
8983
  module.exports = createColors();
@@ -9180,7 +9179,7 @@
9180
9179
  "use strict";
9181
9180
  const fs = __nccwpck_require__(7147);
9182
9181
  const path = __nccwpck_require__(1017);
9183
- const { bold } = __nccwpck_require__(78);
9182
+ const { bold } = __nccwpck_require__(5209);
9184
9183
  const Logger = __nccwpck_require__(1283);
9185
9184
  const viewer = __nccwpck_require__(7498);
9186
9185
  const utils = __nccwpck_require__(5554);
@@ -10522,7 +10521,7 @@
10522
10521
  const http = __nccwpck_require__(3685);
10523
10522
  const WebSocket = __nccwpck_require__(6057);
10524
10523
  const sirv = __nccwpck_require__(2486);
10525
- const { bold } = __nccwpck_require__(78);
10524
+ const { bold } = __nccwpck_require__(5209);
10526
10525
  const Logger = __nccwpck_require__(1283);
10527
10526
  const analyzer = __nccwpck_require__(3377);
10528
10527
  const { open } = __nccwpck_require__(5554);
@@ -13284,10 +13283,6 @@
13284
13283
  "use strict";
13285
13284
  module.exports = require("tls");
13286
13285
  },
13287
- 6224: (module) => {
13288
- "use strict";
13289
- module.exports = require("tty");
13290
- },
13291
13286
  7310: (module) => {
13292
13287
  "use strict";
13293
13288
  module.exports = require("url");
package/dist/index.cjs CHANGED
@@ -5728,11 +5728,31 @@ function initPluginAPI({
5728
5728
  let transformId = 0;
5729
5729
  const transformer = {};
5730
5730
  const processAssetsFns = [];
5731
+ const resolveFns = [];
5731
5732
  hooks.modifyBundlerChain.tap((chain, { target, environment }) => {
5732
5733
  const pluginName = "RsbuildCorePlugin";
5733
5734
  class RsbuildCorePlugin {
5734
5735
  apply(compiler) {
5735
5736
  compiler.__rsbuildTransformer = transformer;
5737
+ for (const { handler, environment: pluginEnvironment } of resolveFns) {
5738
+ if (pluginEnvironment && !isPluginMatchEnvironment(pluginEnvironment, environment.name)) {
5739
+ return;
5740
+ }
5741
+ compiler.hooks.compilation.tap(
5742
+ pluginName,
5743
+ (compilation, { normalModuleFactory }) => {
5744
+ normalModuleFactory.hooks.resolve.tapPromise(
5745
+ pluginName,
5746
+ async (resolveData) => handler({
5747
+ compiler,
5748
+ compilation,
5749
+ environment,
5750
+ resolveData
5751
+ })
5752
+ );
5753
+ }
5754
+ );
5755
+ }
5736
5756
  compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
5737
5757
  compilation.hooks.childCompiler.tap(pluginName, (childCompiler) => {
5738
5758
  childCompiler.__rsbuildTransformer = transformer;
@@ -5800,6 +5820,9 @@ function initPluginAPI({
5800
5820
  const setProcessAssets = (environment) => (descriptor, handler) => {
5801
5821
  processAssetsFns.push({ environment, descriptor, handler });
5802
5822
  };
5823
+ const setResolve = (environment) => (handler) => {
5824
+ resolveFns.push({ environment, handler });
5825
+ };
5803
5826
  let onExitListened = false;
5804
5827
  const onExit = (cb) => {
5805
5828
  if (!onExitListened) {
@@ -5816,6 +5839,7 @@ function initPluginAPI({
5816
5839
  transform: getTransformFn(environment),
5817
5840
  useExposed,
5818
5841
  processAssets: setProcessAssets(environment),
5842
+ resolve: setResolve(environment),
5819
5843
  getRsbuildConfig,
5820
5844
  getNormalizedConfig,
5821
5845
  isPluginExists: pluginManager.isPluginExists,
@@ -6018,7 +6042,7 @@ async function createContext(options, userConfig, bundlerType) {
6018
6042
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
6019
6043
  const cachePath = (0, import_node_path10.join)(rootPath, "node_modules", ".cache");
6020
6044
  return {
6021
- version: "1.0.16",
6045
+ version: "1.0.17",
6022
6046
  rootPath,
6023
6047
  distPath: "",
6024
6048
  cachePath,
@@ -9777,7 +9801,7 @@ function getPublicPath({
9777
9801
  config,
9778
9802
  context
9779
9803
  }) {
9780
- const { dev, output } = config;
9804
+ const { dev, output, server } = config;
9781
9805
  let publicPath = DEFAULT_ASSET_PREFIX;
9782
9806
  const port = context.devServer?.port || DEFAULT_PORT;
9783
9807
  if (isProd) {
@@ -9795,6 +9819,9 @@ function getPublicPath({
9795
9819
  } else {
9796
9820
  publicPath = `${protocol}://${hostname}:<port>/`;
9797
9821
  }
9822
+ if (server.base && server.base !== "/") {
9823
+ publicPath = urlJoin(publicPath, server.base);
9824
+ }
9798
9825
  }
9799
9826
  return formatPublicPath(replacePortPlaceholder(publicPath, port));
9800
9827
  }
@@ -12623,7 +12650,7 @@ function pluginModuleFederation() {
12623
12650
  config.dev.client.port = config.server.port;
12624
12651
  }
12625
12652
  const originalConfig = api.getRsbuildConfig("original");
12626
- if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === DEFAULT_ASSET_PREFIX) {
12653
+ if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === config.server?.base) {
12627
12654
  config.dev.assetPrefix = true;
12628
12655
  }
12629
12656
  }
@@ -12671,7 +12698,6 @@ var init_moduleFederation = __esm({
12671
12698
  "use strict";
12672
12699
  import_types2 = require("util/types");
12673
12700
  import_core8 = require("@rspack/core");
12674
- init_constants();
12675
12701
  PatchSplitChunksPlugin = class {
12676
12702
  constructor(name) {
12677
12703
  __publicField(this, "name");
@@ -13583,7 +13609,7 @@ var init_init = __esm({
13583
13609
 
13584
13610
  // src/cli/commands.ts
13585
13611
  function runCli() {
13586
- program.name("rsbuild").usage("<command> [options]").version("1.0.16");
13612
+ program.name("rsbuild").usage("<command> [options]").version("1.0.17");
13587
13613
  const devCommand = program.command("dev");
13588
13614
  const buildCommand = program.command("build");
13589
13615
  const previewCommand = program.command("preview");
@@ -13692,7 +13718,7 @@ function prepareCli() {
13692
13718
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
13693
13719
  console.log();
13694
13720
  }
13695
- import_rslog.logger.greet(` ${`Rsbuild v${"1.0.16"}`}
13721
+ import_rslog.logger.greet(` ${`Rsbuild v${"1.0.17"}`}
13696
13722
  `);
13697
13723
  }
13698
13724
  var import_node_module;
@@ -13778,7 +13804,7 @@ init_logger();
13778
13804
  init_mergeConfig();
13779
13805
  init_helpers();
13780
13806
  init_constants();
13781
- var version = "1.0.16";
13807
+ var version = "1.0.17";
13782
13808
  // Annotate the CommonJS export names for ESM import in node:
13783
13809
  0 && (module.exports = {
13784
13810
  PLUGIN_CSS_NAME,
package/dist/index.js CHANGED
@@ -46,12 +46,12 @@ var __publicField = (obj, key, value) => {
46
46
  return value;
47
47
  };
48
48
 
49
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js
49
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.60.4_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js
50
50
  import path from "path";
51
51
  import { fileURLToPath } from "url";
52
52
  var getFilename, getDirname, __dirname, __filename;
53
53
  var init_esm = __esm({
54
- "../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js"() {
54
+ "../../node_modules/.pnpm/@modern-js+module-tools@2.60.4_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js"() {
55
55
  "use strict";
56
56
  getFilename = () => fileURLToPath(import.meta.url);
57
57
  getDirname = () => path.dirname(getFilename());
@@ -5776,11 +5776,31 @@ function initPluginAPI({
5776
5776
  let transformId = 0;
5777
5777
  const transformer = {};
5778
5778
  const processAssetsFns = [];
5779
+ const resolveFns = [];
5779
5780
  hooks.modifyBundlerChain.tap((chain, { target, environment }) => {
5780
5781
  const pluginName = "RsbuildCorePlugin";
5781
5782
  class RsbuildCorePlugin {
5782
5783
  apply(compiler) {
5783
5784
  compiler.__rsbuildTransformer = transformer;
5785
+ for (const { handler, environment: pluginEnvironment } of resolveFns) {
5786
+ if (pluginEnvironment && !isPluginMatchEnvironment(pluginEnvironment, environment.name)) {
5787
+ return;
5788
+ }
5789
+ compiler.hooks.compilation.tap(
5790
+ pluginName,
5791
+ (compilation, { normalModuleFactory }) => {
5792
+ normalModuleFactory.hooks.resolve.tapPromise(
5793
+ pluginName,
5794
+ async (resolveData) => handler({
5795
+ compiler,
5796
+ compilation,
5797
+ environment,
5798
+ resolveData
5799
+ })
5800
+ );
5801
+ }
5802
+ );
5803
+ }
5784
5804
  compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
5785
5805
  compilation.hooks.childCompiler.tap(pluginName, (childCompiler) => {
5786
5806
  childCompiler.__rsbuildTransformer = transformer;
@@ -5848,6 +5868,9 @@ function initPluginAPI({
5848
5868
  const setProcessAssets = (environment) => (descriptor, handler) => {
5849
5869
  processAssetsFns.push({ environment, descriptor, handler });
5850
5870
  };
5871
+ const setResolve = (environment) => (handler) => {
5872
+ resolveFns.push({ environment, handler });
5873
+ };
5851
5874
  let onExitListened = false;
5852
5875
  const onExit = (cb) => {
5853
5876
  if (!onExitListened) {
@@ -5864,6 +5887,7 @@ function initPluginAPI({
5864
5887
  transform: getTransformFn(environment),
5865
5888
  useExposed,
5866
5889
  processAssets: setProcessAssets(environment),
5890
+ resolve: setResolve(environment),
5867
5891
  getRsbuildConfig,
5868
5892
  getNormalizedConfig,
5869
5893
  isPluginExists: pluginManager.isPluginExists,
@@ -6067,7 +6091,7 @@ async function createContext(options, userConfig, bundlerType) {
6067
6091
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
6068
6092
  const cachePath = join6(rootPath, "node_modules", ".cache");
6069
6093
  return {
6070
- version: "1.0.16",
6094
+ version: "1.0.17",
6071
6095
  rootPath,
6072
6096
  distPath: "",
6073
6097
  cachePath,
@@ -9860,7 +9884,7 @@ function getPublicPath({
9860
9884
  config,
9861
9885
  context
9862
9886
  }) {
9863
- const { dev, output } = config;
9887
+ const { dev, output, server } = config;
9864
9888
  let publicPath = DEFAULT_ASSET_PREFIX;
9865
9889
  const port = context.devServer?.port || DEFAULT_PORT;
9866
9890
  if (isProd) {
@@ -9878,6 +9902,9 @@ function getPublicPath({
9878
9902
  } else {
9879
9903
  publicPath = `${protocol}://${hostname}:<port>/`;
9880
9904
  }
9905
+ if (server.base && server.base !== "/") {
9906
+ publicPath = urlJoin(publicPath, server.base);
9907
+ }
9881
9908
  }
9882
9909
  return formatPublicPath(replacePortPlaceholder(publicPath, port));
9883
9910
  }
@@ -12735,7 +12762,7 @@ function pluginModuleFederation() {
12735
12762
  config.dev.client.port = config.server.port;
12736
12763
  }
12737
12764
  const originalConfig = api.getRsbuildConfig("original");
12738
- if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === DEFAULT_ASSET_PREFIX) {
12765
+ if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === config.server?.base) {
12739
12766
  config.dev.assetPrefix = true;
12740
12767
  }
12741
12768
  }
@@ -12782,7 +12809,6 @@ var init_moduleFederation = __esm({
12782
12809
  "src/plugins/moduleFederation.ts"() {
12783
12810
  "use strict";
12784
12811
  init_esm();
12785
- init_constants();
12786
12812
  PatchSplitChunksPlugin = class {
12787
12813
  constructor(name) {
12788
12814
  __publicField(this, "name");
@@ -13701,7 +13727,7 @@ var init_init = __esm({
13701
13727
 
13702
13728
  // src/cli/commands.ts
13703
13729
  function runCli() {
13704
- program.name("rsbuild").usage("<command> [options]").version("1.0.16");
13730
+ program.name("rsbuild").usage("<command> [options]").version("1.0.17");
13705
13731
  const devCommand = program.command("dev");
13706
13732
  const buildCommand = program.command("build");
13707
13733
  const previewCommand = program.command("preview");
@@ -13812,7 +13838,7 @@ function prepareCli() {
13812
13838
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
13813
13839
  console.log();
13814
13840
  }
13815
- logger.greet(` ${`Rsbuild v${"1.0.16"}`}
13841
+ logger.greet(` ${`Rsbuild v${"1.0.17"}`}
13816
13842
  `);
13817
13843
  }
13818
13844
  var init_prepare = __esm({
@@ -13883,7 +13909,7 @@ init_mergeConfig();
13883
13909
  init_helpers();
13884
13910
  init_constants();
13885
13911
  import { rspack as rspack10 } from "@rspack/core";
13886
- var version = "1.0.16";
13912
+ var version = "1.0.17";
13887
13913
  export {
13888
13914
  PLUGIN_CSS_NAME,
13889
13915
  PLUGIN_SWC_NAME,
@@ -20,6 +20,7 @@ export declare const addTrailingSlash: (s: string) => string;
20
20
  export declare const formatPublicPath: (publicPath: string, withSlash?: boolean) => string;
21
21
  export declare const getPublicPathFromChain: (chain: RspackChain, withSlash?: boolean) => string;
22
22
  export declare const getPublicPathFromCompiler: (compiler: Rspack.Compiler | Rspack.Compilation) => string;
23
+ export declare const urlJoin: (base: string, path: string) => string;
23
24
  export declare const canParse: (url: string) => boolean;
24
25
  export declare const ensureAssetPrefix: (url: string, assetPrefix?: Rspack.PublicPath) => string;
25
26
  export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: 'js', isProd: boolean, isServer?: boolean): NonNullable<FilenameConfig['js']>;
@@ -194,7 +194,7 @@ export type TransformDescriptor = {
194
194
  resourceQuery?: Rspack.RuleSetCondition;
195
195
  /**
196
196
  * Match based on the Rsbuild targets and only apply the transform to certain targets.
197
- * @see https://rsbuild.dev/config/output/targets
197
+ * @see https://rsbuild.dev/config/output/target
198
198
  */
199
199
  targets?: RsbuildTarget[];
200
200
  /**
@@ -217,7 +217,7 @@ export type ProcessAssetsDescriptor = {
217
217
  stage: ProcessAssetsStage;
218
218
  /**
219
219
  * Match based on the Rsbuild targets and only process the assets of certain targets.
220
- * @see https://rsbuild.dev/config/output/targets
220
+ * @see https://rsbuild.dev/config/output/target
221
221
  */
222
222
  targets?: RsbuildTarget[];
223
223
  /**
@@ -240,6 +240,15 @@ export type ProcessAssetsHandler = (context: {
240
240
  */
241
241
  sources: RspackSources;
242
242
  }) => Promise<void> | void;
243
+ export type ResolveHandler = (context: {
244
+ /** Module request information */
245
+ resolveData: Rspack.ResolveData;
246
+ /** The environment context for current build. */
247
+ environment: EnvironmentContext;
248
+ compiler: Rspack.Compiler;
249
+ compilation: Rspack.Compilation;
250
+ }) => Promise<void> | void;
251
+ export type ResolveFn = (handler: ResolveHandler) => void;
243
252
  export type ProcessAssetsFn = (descriptor: ProcessAssetsDescriptor, handler: ProcessAssetsHandler) => void;
244
253
  declare function getNormalizedConfig(): NormalizedConfig;
245
254
  declare function getNormalizedConfig(options: {
@@ -289,5 +298,9 @@ export type RsbuildPluginAPI = Readonly<{
289
298
  * Process all the asset generated by Rspack.
290
299
  */
291
300
  processAssets: ProcessAssetsFn;
301
+ /**
302
+ * Defines a custom resolver. A resolver can be useful for e.g. locating third-party dependencies.
303
+ */
304
+ resolve: ResolveFn;
292
305
  }>;
293
306
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,7 +46,7 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "~1.0.13",
49
+ "@rspack/core": "~1.0.14",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.13",
52
52
  "core-js": "~3.38.1"
@@ -75,7 +75,7 @@
75
75
  "mrmime": "^2.0.0",
76
76
  "on-finished": "2.4.1",
77
77
  "open": "^8.4.0",
78
- "picocolors": "^1.1.0",
78
+ "picocolors": "^1.1.1",
79
79
  "postcss": "^8.4.47",
80
80
  "postcss-load-config": "6.0.1",
81
81
  "postcss-loader": "8.1.1",