@rsbuild/core 1.0.1-beta.5 → 1.0.1-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 7286: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 7532: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(5866);
5
+ const loader = __nccwpck_require__(2056);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(7040).defaultGetLocalIdent;
8
+ __nccwpck_require__(6867).defaultGetLocalIdent;
9
9
  },
10
- 5866: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 2056: (__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__(977));
15
15
  var _package = _interopRequireDefault(__nccwpck_require__(7972));
16
16
  var _semver = __nccwpck_require__(938);
17
- var _options = _interopRequireDefault(__nccwpck_require__(1991));
18
- var _plugins = __nccwpck_require__(2754);
19
- var _utils = __nccwpck_require__(7040);
17
+ var _options = _interopRequireDefault(__nccwpck_require__(3815));
18
+ var _plugins = __nccwpck_require__(9775);
19
+ var _utils = __nccwpck_require__(6867);
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
- 2754: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 9775: (__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__(4460),
268
+ __nccwpck_require__(3271),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(8815),
271
+ __nccwpck_require__(9469),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(2374));
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(5044));
274
274
  function _interopRequireDefault(obj) {
275
275
  return obj && obj.__esModule ? obj : { default: obj };
276
276
  }
277
277
  },
278
- 8815: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 9469: (__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__(2304);
283
- var _utils = __nccwpck_require__(7040);
283
+ var _utils = __nccwpck_require__(6867);
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
- 4460: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 3271: (__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__(1036),
388
388
  );
389
- var _utils = __nccwpck_require__(7040);
389
+ var _utils = __nccwpck_require__(6867);
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
- 2374: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 5044: (__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__(1036),
700
700
  );
701
- var _utils = __nccwpck_require__(7040);
701
+ var _utils = __nccwpck_require__(6867);
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
- 7040: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 6867: (__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;
@@ -7501,7 +7501,7 @@
7501
7501
  "use strict";
7502
7502
  module.exports = require("util");
7503
7503
  },
7504
- 1991: (module) => {
7504
+ 3815: (module) => {
7505
7505
  "use strict";
7506
7506
  module.exports = JSON.parse(
7507
7507
  '{"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"}',
@@ -7536,6 +7536,6 @@
7536
7536
  }
7537
7537
  if (typeof __nccwpck_require__ !== "undefined")
7538
7538
  __nccwpck_require__.ab = __dirname + "/";
7539
- var __webpack_exports__ = __nccwpck_require__(7286);
7539
+ var __webpack_exports__ = __nccwpck_require__(7532);
7540
7540
  module.exports = __webpack_exports__;
7541
7541
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 737: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 642: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(937);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(153);
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
- 937: (module) => {
307
+ 153: (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
- 798: (module) => {
468
+ 993: (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
- 255: (module) => {
487
+ 954: (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
- 0: (module, __unused_webpack_exports, __nccwpck_require__) => {
508
+ 400: (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
- 93: (module) => {
534
+ 196: (module) => {
535
535
  const voidTags = [
536
536
  "area",
537
537
  "base",
@@ -599,19 +599,19 @@
599
599
  htmlTagObjectToString,
600
600
  };
601
601
  },
602
- 592: (module, __unused_webpack_exports, __nccwpck_require__) => {
602
+ 527: (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__(737);
608
+ const { CachedChildCompilation } = __nccwpck_require__(642);
609
609
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
610
- __nccwpck_require__(93);
611
- const prettyError = __nccwpck_require__(255);
612
- const chunkSorter = __nccwpck_require__(798);
610
+ __nccwpck_require__(196);
611
+ const prettyError = __nccwpck_require__(954);
612
+ const chunkSorter = __nccwpck_require__(993);
613
613
  const getHtmlRspackPluginHooks =
614
- __nccwpck_require__(0).getHtmlRspackPluginHooks;
614
+ __nccwpck_require__(400).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__(592);
1572
+ var __webpack_exports__ = __nccwpck_require__(527);
1573
1573
  module.exports = __webpack_exports__;
1574
1574
  })();
@@ -6780,19 +6780,19 @@
6780
6780
  module.exports = createColors();
6781
6781
  module.exports.createColors = createColors;
6782
6782
  },
6783
- 9337: (module, __unused_webpack_exports, __nccwpck_require__) => {
6783
+ 2468: (module, __unused_webpack_exports, __nccwpck_require__) => {
6784
6784
  "use strict";
6785
- module.exports = __nccwpck_require__(8725)["default"];
6785
+ module.exports = __nccwpck_require__(7400)["default"];
6786
6786
  },
6787
- 8725: (__unused_webpack_module, exports, __nccwpck_require__) => {
6787
+ 7400: (__unused_webpack_module, exports, __nccwpck_require__) => {
6788
6788
  "use strict";
6789
6789
  var __webpack_unused_export__;
6790
6790
  __webpack_unused_export__ = { value: true };
6791
6791
  exports["default"] = loader;
6792
6792
  var _path = _interopRequireDefault(__nccwpck_require__(1017));
6793
6793
  var _package = _interopRequireDefault(__nccwpck_require__(7972));
6794
- var _options = _interopRequireDefault(__nccwpck_require__(8850));
6795
- var _utils = __nccwpck_require__(8084);
6794
+ var _options = _interopRequireDefault(__nccwpck_require__(5033));
6795
+ var _utils = __nccwpck_require__(9593);
6796
6796
  function _interopRequireDefault(obj) {
6797
6797
  return obj && obj.__esModule ? obj : { default: obj };
6798
6798
  }
@@ -6970,7 +6970,7 @@
6970
6970
  callback(null, result.css, map, { ast });
6971
6971
  }
6972
6972
  },
6973
- 8084: (module, exports, __nccwpck_require__) => {
6973
+ 9593: (module, exports, __nccwpck_require__) => {
6974
6974
  "use strict";
6975
6975
  module = __nccwpck_require__.nmd(module);
6976
6976
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -8308,7 +8308,7 @@
8308
8308
  };
8309
8309
  }
8310
8310
  },
8311
- 8850: (module) => {
8311
+ 5033: (module) => {
8312
8312
  "use strict";
8313
8313
  module.exports = JSON.parse(
8314
8314
  '{"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}',
@@ -8418,6 +8418,6 @@
8418
8418
  })();
8419
8419
  if (typeof __nccwpck_require__ !== "undefined")
8420
8420
  __nccwpck_require__.ab = __dirname + "/";
8421
- var __webpack_exports__ = __nccwpck_require__(9337);
8421
+ var __webpack_exports__ = __nccwpck_require__(2468);
8422
8422
  module.exports = __webpack_exports__;
8423
8423
  })();
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 9161: (__unused_webpack_module, exports, __nccwpck_require__) => {
3
+ 8642: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
4
  "use strict";
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.transformFiles =
@@ -120,7 +120,7 @@
120
120
  .map(standardizeFilePaths);
121
121
  exports.transformFiles = transformFiles;
122
122
  },
123
- 4431: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 9657: (__unused_webpack_module, exports, __nccwpck_require__) => {
124
124
  "use strict";
125
125
  Object.defineProperty(exports, "__esModule", { value: true });
126
126
  exports.normalModuleLoaderHook =
@@ -132,7 +132,7 @@
132
132
  const path_1 = __nccwpck_require__(1017);
133
133
  const tapable_1 = __nccwpck_require__(4260);
134
134
  const webpack_sources_1 = __nccwpck_require__(5433);
135
- const helpers_1 = __nccwpck_require__(9161);
135
+ const helpers_1 = __nccwpck_require__(8642);
136
136
  const compilerHookMap = new WeakMap();
137
137
  const getCompilerHooks = (compiler) => {
138
138
  let hooks = compilerHookMap.get(compiler);
@@ -5802,7 +5802,7 @@
5802
5802
  exports.getCompilerHooks =
5803
5803
  void 0;
5804
5804
  const path_1 = __nccwpck_require__(1017);
5805
- const hooks_1 = __nccwpck_require__(4431);
5805
+ const hooks_1 = __nccwpck_require__(9657);
5806
5806
  Object.defineProperty(exports, "getCompilerHooks", {
5807
5807
  enumerable: true,
5808
5808
  get: function () {
package/dist/index.cjs CHANGED
@@ -704,6 +704,9 @@ ${import_picocolors2.default.yellow(tips.join("\n"))}`;
704
704
  if (assetPrefix === "auto") {
705
705
  return url2;
706
706
  }
707
+ if (typeof assetPrefix === "function") {
708
+ return url2;
709
+ }
707
710
  if (assetPrefix.startsWith("http")) {
708
711
  return urlJoin(assetPrefix, url2);
709
712
  }
@@ -1954,7 +1957,7 @@ async function createContextByConfig(options, bundlerType) {
1954
1957
  const rootPath = cwd;
1955
1958
  const cachePath = (0, import_node_path8.join)(rootPath, "node_modules", ".cache");
1956
1959
  return {
1957
- version: "1.0.1-beta.5",
1960
+ version: "1.0.1-beta.6",
1958
1961
  rootPath,
1959
1962
  distPath: "",
1960
1963
  cachePath,
@@ -2156,10 +2159,7 @@ async function inspectConfig({
2156
2159
  inspectOptions,
2157
2160
  pluginManager
2158
2161
  });
2159
- let outputPath = inspectOptions.outputPath ? (0, import_node_path9.join)(context.distPath, inspectOptions.outputPath) : context.distPath;
2160
- if (!(0, import_node_path9.isAbsolute)(outputPath)) {
2161
- outputPath = (0, import_node_path9.join)(context.rootPath, outputPath);
2162
- }
2162
+ const outputPath = getInspectOutputPath(context, inspectOptions);
2163
2163
  if (inspectOptions.writeToDisk) {
2164
2164
  await outputInspectConfigFiles({
2165
2165
  rawBundlerConfigs,
@@ -2182,7 +2182,7 @@ async function inspectConfig({
2182
2182
  }
2183
2183
  };
2184
2184
  }
2185
- var import_node_path9;
2185
+ var import_node_path9, getInspectOutputPath;
2186
2186
  var init_inspectConfig = __esm({
2187
2187
  "src/provider/inspectConfig.ts"() {
2188
2188
  "use strict";
@@ -2190,6 +2190,15 @@ var init_inspectConfig = __esm({
2190
2190
  init_config();
2191
2191
  init_helpers();
2192
2192
  init_initConfigs();
2193
+ getInspectOutputPath = (context, inspectOptions) => {
2194
+ if (inspectOptions.outputPath) {
2195
+ if ((0, import_node_path9.isAbsolute)(inspectOptions.outputPath)) {
2196
+ return inspectOptions.outputPath;
2197
+ }
2198
+ return (0, import_node_path9.join)(context.distPath, inspectOptions.outputPath);
2199
+ }
2200
+ return context.distPath;
2201
+ };
2193
2202
  }
2194
2203
  });
2195
2204
 
@@ -9063,7 +9072,7 @@ var init_init = __esm({
9063
9072
 
9064
9073
  // src/cli/commands.ts
9065
9074
  function runCli() {
9066
- import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.1-beta.5");
9075
+ import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.1-beta.6");
9067
9076
  const devCommand = import_commander.program.command("dev");
9068
9077
  const buildCommand = import_commander.program.command("build");
9069
9078
  const previewCommand = import_commander.program.command("preview");
@@ -9122,7 +9131,7 @@ function runCli() {
9122
9131
  process.exit(1);
9123
9132
  }
9124
9133
  });
9125
- inspectCommand.description("inspect the Rspack and Rsbuild configs").option("--env <env>", "specify env mode", "development").option("--output <output>", "specify inspect content output path", "/").option("--verbose", "show full function definitions in output").action(async (options) => {
9134
+ inspectCommand.description("inspect the Rspack and Rsbuild configs").option("--env <env>", "specify env mode", "development").option("--output <output>", "specify inspect content output path").option("--verbose", "show full function definitions in output").action(async (options) => {
9126
9135
  try {
9127
9136
  const rsbuild = await init({ cliOptions: options });
9128
9137
  await rsbuild?.inspectConfig({
@@ -9177,7 +9186,7 @@ function prepareCli() {
9177
9186
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9178
9187
  console.log();
9179
9188
  }
9180
- import_rslog.logger.greet(` ${`Rsbuild v${"1.0.1-beta.5"}`}
9189
+ import_rslog.logger.greet(` ${`Rsbuild v${"1.0.1-beta.6"}`}
9181
9190
  `);
9182
9191
  }
9183
9192
  var init_prepare = __esm({
@@ -9260,7 +9269,7 @@ init_logger();
9260
9269
  init_mergeConfig();
9261
9270
  init_helpers();
9262
9271
  init_constants();
9263
- var version = "1.0.1-beta.5";
9272
+ var version = "1.0.1-beta.6";
9264
9273
  // Annotate the CommonJS export names for ESM import in node:
9265
9274
  0 && (module.exports = {
9266
9275
  PLUGIN_CSS_NAME,
package/dist/index.js CHANGED
@@ -731,6 +731,9 @@ ${color2.yellow(tips.join("\n"))}`;
731
731
  if (assetPrefix === "auto") {
732
732
  return url2;
733
733
  }
734
+ if (typeof assetPrefix === "function") {
735
+ return url2;
736
+ }
734
737
  if (assetPrefix.startsWith("http")) {
735
738
  return urlJoin(assetPrefix, url2);
736
739
  }
@@ -1990,7 +1993,7 @@ async function createContextByConfig(options, bundlerType) {
1990
1993
  const rootPath = cwd;
1991
1994
  const cachePath = join6(rootPath, "node_modules", ".cache");
1992
1995
  return {
1993
- version: "1.0.1-beta.5",
1996
+ version: "1.0.1-beta.6",
1994
1997
  rootPath,
1995
1998
  distPath: "",
1996
1999
  cachePath,
@@ -2193,10 +2196,7 @@ async function inspectConfig({
2193
2196
  inspectOptions,
2194
2197
  pluginManager
2195
2198
  });
2196
- let outputPath = inspectOptions.outputPath ? join7(context.distPath, inspectOptions.outputPath) : context.distPath;
2197
- if (!isAbsolute4(outputPath)) {
2198
- outputPath = join7(context.rootPath, outputPath);
2199
- }
2199
+ const outputPath = getInspectOutputPath(context, inspectOptions);
2200
2200
  if (inspectOptions.writeToDisk) {
2201
2201
  await outputInspectConfigFiles({
2202
2202
  rawBundlerConfigs,
@@ -2219,6 +2219,7 @@ async function inspectConfig({
2219
2219
  }
2220
2220
  };
2221
2221
  }
2222
+ var getInspectOutputPath;
2222
2223
  var init_inspectConfig = __esm({
2223
2224
  "src/provider/inspectConfig.ts"() {
2224
2225
  "use strict";
@@ -2226,6 +2227,15 @@ var init_inspectConfig = __esm({
2226
2227
  init_config();
2227
2228
  init_helpers();
2228
2229
  init_initConfigs();
2230
+ getInspectOutputPath = (context, inspectOptions) => {
2231
+ if (inspectOptions.outputPath) {
2232
+ if (isAbsolute4(inspectOptions.outputPath)) {
2233
+ return inspectOptions.outputPath;
2234
+ }
2235
+ return join7(context.distPath, inspectOptions.outputPath);
2236
+ }
2237
+ return context.distPath;
2238
+ };
2229
2239
  }
2230
2240
  });
2231
2241
 
@@ -9168,7 +9178,7 @@ import { existsSync } from "fs";
9168
9178
  import { program } from "../compiled/commander/index.js";
9169
9179
  import color14 from "../compiled/picocolors/index.js";
9170
9180
  function runCli() {
9171
- program.name("rsbuild").usage("<command> [options]").version("1.0.1-beta.5");
9181
+ program.name("rsbuild").usage("<command> [options]").version("1.0.1-beta.6");
9172
9182
  const devCommand = program.command("dev");
9173
9183
  const buildCommand = program.command("build");
9174
9184
  const previewCommand = program.command("preview");
@@ -9227,7 +9237,7 @@ function runCli() {
9227
9237
  process.exit(1);
9228
9238
  }
9229
9239
  });
9230
- inspectCommand.description("inspect the Rspack and Rsbuild configs").option("--env <env>", "specify env mode", "development").option("--output <output>", "specify inspect content output path", "/").option("--verbose", "show full function definitions in output").action(async (options) => {
9240
+ inspectCommand.description("inspect the Rspack and Rsbuild configs").option("--env <env>", "specify env mode", "development").option("--output <output>", "specify inspect content output path").option("--verbose", "show full function definitions in output").action(async (options) => {
9231
9241
  try {
9232
9242
  const rsbuild = await init({ cliOptions: options });
9233
9243
  await rsbuild?.inspectConfig({
@@ -9280,7 +9290,7 @@ function prepareCli() {
9280
9290
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9281
9291
  console.log();
9282
9292
  }
9283
- logger.greet(` ${`Rsbuild v${"1.0.1-beta.5"}`}
9293
+ logger.greet(` ${`Rsbuild v${"1.0.1-beta.6"}`}
9284
9294
  `);
9285
9295
  }
9286
9296
  var init_prepare = __esm({
@@ -9350,7 +9360,7 @@ init_mergeConfig();
9350
9360
  init_helpers();
9351
9361
  init_constants();
9352
9362
  import { rspack as rspack10 } from "@rspack/core";
9353
- var version = "1.0.1-beta.5";
9363
+ var version = "1.0.1-beta.6";
9354
9364
  export {
9355
9365
  PLUGIN_CSS_NAME,
9356
9366
  PLUGIN_SWC_NAME,
@@ -39,7 +39,7 @@ export declare function pathExists(path: string): Promise<boolean>;
39
39
  export declare function isFileExists(file: string): Promise<boolean>;
40
40
  export declare function emptyDir(dir: string): Promise<void>;
41
41
  export declare const canParse: (url: string) => boolean;
42
- export declare const ensureAssetPrefix: (url: string, assetPrefix?: string) => string;
42
+ export declare const ensureAssetPrefix: (url: string, assetPrefix?: Rspack.PublicPath) => string;
43
43
  export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: 'js', isProd: boolean, isServer?: boolean): NonNullable<FilenameConfig['js']>;
44
44
  export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: Exclude<keyof FilenameConfig, 'js'>, isProd: boolean, isServer?: boolean): string;
45
45
  export declare function partition<T>(array: T[], predicate: (value: T) => boolean): [T[], T[]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.0.1-beta.5",
3
+ "version": "1.0.1-beta.6",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -20,7 +20,7 @@
20
20
  "require": "./dist/index.cjs"
21
21
  },
22
22
  "./client/hmr": {
23
- "types": "./dist-types/client/hmr/index.d.ts",
23
+ "types": "./dist-types/client/hmr.d.ts",
24
24
  "default": "./dist/client/hmr.js"
25
25
  },
26
26
  "./client/overlay": {
@@ -46,8 +46,8 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.0.0-alpha.5",
50
- "@rspack/lite-tapable": "1.0.0-alpha.5",
49
+ "@rspack/core": "1.0.0-beta.0",
50
+ "@rspack/lite-tapable": "1.0.0-beta.0",
51
51
  "@swc/helpers": "0.5.11",
52
52
  "caniuse-lite": "^1.0.30001643",
53
53
  "core-js": "~3.37.1",