@rsbuild/core 1.2.17 → 1.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 306: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 7302: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(9232);
5
+ const loader = __nccwpck_require__(2540);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(7193).defaultGetLocalIdent;
8
+ __nccwpck_require__(4485).defaultGetLocalIdent;
9
9
  },
10
- 9232: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 2540: (__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__(9409));
15
- var _plugins = __nccwpck_require__(3695);
16
- var _utils = __nccwpck_require__(7193);
15
+ var _plugins = __nccwpck_require__(35);
16
+ var _utils = __nccwpck_require__(4485);
17
17
  function _interopRequireDefault(obj) {
18
18
  return obj && obj.__esModule ? obj : { default: obj };
19
19
  }
@@ -236,7 +236,7 @@
236
236
  callback(null, `${importCode}${moduleCode}${exportCode}`);
237
237
  }
238
238
  },
239
- 3695: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 35: (__unused_webpack_module, exports, __nccwpck_require__) => {
240
240
  "use strict";
241
241
  Object.defineProperty(exports, "__esModule", { value: true });
242
242
  Object.defineProperty(exports, "icssParser", {
@@ -258,22 +258,20 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(7068),
261
+ __nccwpck_require__(7608),
262
262
  );
263
- var _postcssIcssParser = _interopRequireDefault(
264
- __nccwpck_require__(7113),
265
- );
266
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4400));
263
+ var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(301));
264
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(2700));
267
265
  function _interopRequireDefault(obj) {
268
266
  return obj && obj.__esModule ? obj : { default: obj };
269
267
  }
270
268
  },
271
- 7113: (__unused_webpack_module, exports, __nccwpck_require__) => {
269
+ 301: (__unused_webpack_module, exports, __nccwpck_require__) => {
272
270
  "use strict";
273
271
  Object.defineProperty(exports, "__esModule", { value: true });
274
272
  exports["default"] = void 0;
275
273
  var _icssUtils = __nccwpck_require__(4531);
276
- var _utils = __nccwpck_require__(7193);
274
+ var _utils = __nccwpck_require__(4485);
277
275
  const plugin = (options = {}) => ({
278
276
  postcssPlugin: "postcss-icss-parser",
279
277
  async OnceExit(root) {
@@ -372,14 +370,14 @@
372
370
  plugin.postcss = true;
373
371
  var _default = (exports["default"] = plugin);
374
372
  },
375
- 7068: (__unused_webpack_module, exports, __nccwpck_require__) => {
373
+ 7608: (__unused_webpack_module, exports, __nccwpck_require__) => {
376
374
  "use strict";
377
375
  Object.defineProperty(exports, "__esModule", { value: true });
378
376
  exports["default"] = void 0;
379
377
  var _postcssValueParser = _interopRequireDefault(
380
378
  __nccwpck_require__(2948),
381
379
  );
382
- var _utils = __nccwpck_require__(7193);
380
+ var _utils = __nccwpck_require__(4485);
383
381
  function _interopRequireDefault(obj) {
384
382
  return obj && obj.__esModule ? obj : { default: obj };
385
383
  }
@@ -684,14 +682,14 @@
684
682
  plugin.postcss = true;
685
683
  var _default = (exports["default"] = plugin);
686
684
  },
687
- 4400: (__unused_webpack_module, exports, __nccwpck_require__) => {
685
+ 2700: (__unused_webpack_module, exports, __nccwpck_require__) => {
688
686
  "use strict";
689
687
  Object.defineProperty(exports, "__esModule", { value: true });
690
688
  exports["default"] = void 0;
691
689
  var _postcssValueParser = _interopRequireDefault(
692
690
  __nccwpck_require__(2948),
693
691
  );
694
- var _utils = __nccwpck_require__(7193);
692
+ var _utils = __nccwpck_require__(4485);
695
693
  function _interopRequireDefault(obj) {
696
694
  return obj && obj.__esModule ? obj : { default: obj };
697
695
  }
@@ -1034,7 +1032,7 @@
1034
1032
  plugin.postcss = true;
1035
1033
  var _default = (exports["default"] = plugin);
1036
1034
  },
1037
- 7193: (__unused_webpack_module, exports, __nccwpck_require__) => {
1035
+ 4485: (__unused_webpack_module, exports, __nccwpck_require__) => {
1038
1036
  "use strict";
1039
1037
  Object.defineProperty(exports, "__esModule", { value: true });
1040
1038
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8098,6 +8096,6 @@
8098
8096
  }
8099
8097
  if (typeof __nccwpck_require__ !== "undefined")
8100
8098
  __nccwpck_require__.ab = __dirname + "/";
8101
- var __webpack_exports__ = __nccwpck_require__(306);
8099
+ var __webpack_exports__ = __nccwpck_require__(7302);
8102
8100
  module.exports = __webpack_exports__;
8103
8101
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 744: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 555: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(525);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(360);
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
- 525: (module) => {
307
+ 360: (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
- 835: (module) => {
476
+ 16: (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
- 518: (module) => {
495
+ 223: (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
- 621: (module, __unused_webpack_exports, __nccwpck_require__) => {
516
+ 910: (module, __unused_webpack_exports, __nccwpck_require__) => {
517
517
  "use strict";
518
518
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
519
519
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -539,7 +539,7 @@
539
539
  }
540
540
  module.exports = { getHtmlRspackPluginHooks };
541
541
  },
542
- 716: (module) => {
542
+ 315: (module) => {
543
543
  const voidTags = [
544
544
  "area",
545
545
  "base",
@@ -607,19 +607,19 @@
607
607
  htmlTagObjectToString,
608
608
  };
609
609
  },
610
- 185: (module, __unused_webpack_exports, __nccwpck_require__) => {
610
+ 850: (module, __unused_webpack_exports, __nccwpck_require__) => {
611
611
  "use strict";
612
612
  const promisify = __nccwpck_require__(23).promisify;
613
613
  const vm = __nccwpck_require__(154);
614
614
  const fs = __nccwpck_require__(896);
615
615
  const path = __nccwpck_require__(928);
616
- const { CachedChildCompilation } = __nccwpck_require__(744);
616
+ const { CachedChildCompilation } = __nccwpck_require__(555);
617
617
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
618
- __nccwpck_require__(716);
619
- const prettyError = __nccwpck_require__(518);
620
- const chunkSorter = __nccwpck_require__(835);
618
+ __nccwpck_require__(315);
619
+ const prettyError = __nccwpck_require__(223);
620
+ const chunkSorter = __nccwpck_require__(16);
621
621
  const getHtmlRspackPluginHooks =
622
- __nccwpck_require__(621).getHtmlRspackPluginHooks;
622
+ __nccwpck_require__(910).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__(185);
1581
+ var __webpack_exports__ = __nccwpck_require__(850);
1582
1582
  module.exports = __webpack_exports__;
1583
1583
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 737: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(123)["default"];
4
+ 290: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(896)["default"];
6
6
  },
7
- 123: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 896: (__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__(928));
12
- var _utils = __nccwpck_require__(358);
12
+ var _utils = __nccwpck_require__(681);
13
13
  function _interopRequireDefault(obj) {
14
14
  return obj && obj.__esModule ? obj : { default: obj };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 358: (module, exports, __nccwpck_require__) => {
182
+ 681: (module, exports, __nccwpck_require__) => {
183
183
  module = __nccwpck_require__.nmd(module);
184
184
  Object.defineProperty(exports, "__esModule", { value: true });
185
185
  exports.exec = exec;
@@ -716,6 +716,6 @@
716
716
  })();
717
717
  if (typeof __nccwpck_require__ !== "undefined")
718
718
  __nccwpck_require__.ab = __dirname + "/";
719
- var __webpack_exports__ = __nccwpck_require__(737);
719
+ var __webpack_exports__ = __nccwpck_require__(290);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 705: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 664: (__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
- 964: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 289: (__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__(896);
131
131
  const path_1 = __nccwpck_require__(928);
132
132
  const lite_tapable_1 = __nccwpck_require__(408);
133
- const helpers_1 = __nccwpck_require__(705);
133
+ const helpers_1 = __nccwpck_require__(664);
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__(928);
315
- const hooks_1 = __nccwpck_require__(964);
315
+ const hooks_1 = __nccwpck_require__(289);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
package/dist/index.cjs CHANGED
@@ -1297,7 +1297,7 @@ var __webpack_exports__ = {};
1297
1297
  return statsData.warningsCount && (null === (_statsData_warnings = statsData.warnings) || void 0 === _statsData_warnings ? void 0 : _statsData_warnings.length) === 0 ? null === (_statsData_children = statsData.children) || void 0 === _statsData_children ? void 0 : _statsData_children.reduce((warnings, curr)=>warnings.concat(curr.warnings || []), []) : statsData.warnings;
1298
1298
  };
1299
1299
  function getStatsOptions(compiler) {
1300
- if (isMultiCompiler(compiler)) return {
1300
+ if (helpers_isMultiCompiler(compiler)) return {
1301
1301
  children: compiler.compilers.map((compiler)=>compiler.options ? compiler.options.stats : void 0)
1302
1302
  };
1303
1303
  let { stats } = compiler.options;
@@ -1396,8 +1396,8 @@ var __webpack_exports__ = {};
1396
1396
  }
1397
1397
  }
1398
1398
  let applyToCompiler = (compiler, apply)=>{
1399
- isMultiCompiler(compiler) ? compiler.compilers.forEach(apply) : apply(compiler, 0);
1400
- }, upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', isURL = (str)=>str.startsWith('http') || str.startsWith('//:'), createVirtualModule = (content)=>`data:text/javascript,${content}`, isMultiCompiler = (compiler)=>'compilers' in compiler && Array.isArray(compiler.compilers);
1399
+ helpers_isMultiCompiler(compiler) ? compiler.compilers.forEach(apply) : apply(compiler, 0);
1400
+ }, upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', isURL = (str)=>str.startsWith('http') || str.startsWith('//:'), createVirtualModule = (content)=>`data:text/javascript,${content}`, helpers_isMultiCompiler = (compiler)=>'compilers' in compiler && Array.isArray(compiler.compilers);
1401
1401
  function pick(obj, keys) {
1402
1402
  return keys.reduce((ret, key)=>(void 0 !== obj[key] && (ret[key] = obj[key]), ret), {});
1403
1403
  }
@@ -2143,7 +2143,7 @@ var __webpack_exports__ = {};
2143
2143
  }
2144
2144
  let onBeforeCompile = ({ compiler, beforeCompile, beforeEnvironmentCompiler, isWatch })=>{
2145
2145
  let name = 'rsbuild:beforeCompile';
2146
- if (isMultiCompiler(compiler)) {
2146
+ if (helpers_isMultiCompiler(compiler)) {
2147
2147
  let waitBeforeCompileDone;
2148
2148
  let { compilers } = compiler, doneCompilers = 0;
2149
2149
  for(let index = 0; index < compilers.length; index++){
@@ -2158,7 +2158,7 @@ var __webpack_exports__ = {};
2158
2158
  await (null == beforeCompile ? void 0 : beforeCompile()), await beforeEnvironmentCompiler(0);
2159
2159
  });
2160
2160
  }, onCompileDone = ({ compiler, onDone, onEnvironmentDone, MultiStatsCtor })=>{
2161
- if (isMultiCompiler(compiler)) {
2161
+ if (helpers_isMultiCompiler(compiler)) {
2162
2162
  let { compilers } = compiler, compilerStats = [], doneCompilers = 0;
2163
2163
  for(let index = 0; index < compilers.length; index++){
2164
2164
  let compiler = compilers[index], compilerIndex = index, compilerDone = !1;
@@ -2382,7 +2382,7 @@ var __webpack_exports__ = {};
2382
2382
  async function createContext(options, userConfig, bundlerType) {
2383
2383
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
2384
2384
  return {
2385
- version: "1.2.17",
2385
+ version: "1.2.18",
2386
2386
  rootPath,
2387
2387
  distPath: '',
2388
2388
  cachePath,
@@ -4901,22 +4901,25 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4901
4901
  };
4902
4902
  }
4903
4903
  var dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
4904
- async function modifyRspackConfig(context, rspackConfig, utils) {
4904
+ async function modifyRspackConfig(context, rspackConfig, chainUtils) {
4905
4905
  var _utils_environment_config_tools;
4906
4906
  rslog_index_js_namespaceObject.logger.debug('modify Rspack config');
4907
- let [modifiedConfig] = await context.hooks.modifyRspackConfig.callChain({
4907
+ let currentConfig = rspackConfig, proxiedConfig = new Proxy({}, {
4908
+ get: (_, prop)=>currentConfig[prop],
4909
+ set: (_, prop, value)=>(currentConfig[prop] = value, !0)
4910
+ }), utils = await getConfigUtils(proxiedConfig, chainUtils);
4911
+ return [currentConfig] = await context.hooks.modifyRspackConfig.callChain({
4908
4912
  environment: utils.environment.name,
4909
4913
  args: [
4910
4914
  rspackConfig,
4911
4915
  utils
4912
4916
  ]
4913
- });
4914
- return (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.rspack) && (modifiedConfig = await reduceConfigsAsyncWithContext({
4915
- initial: modifiedConfig,
4917
+ }), (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.rspack) && (currentConfig = await reduceConfigsAsyncWithContext({
4918
+ initial: currentConfig,
4916
4919
  config: utils.environment.config.tools.rspack,
4917
4920
  ctx: utils,
4918
- mergeFn: utils.mergeConfig
4919
- })), rslog_index_js_namespaceObject.logger.debug('modify Rspack config done'), modifiedConfig;
4921
+ mergeFn: (...args)=>currentConfig = utils.mergeConfig.call(utils, args)
4922
+ })), rslog_index_js_namespaceObject.logger.debug('modify Rspack config done'), currentConfig;
4920
4923
  }
4921
4924
  async function getConfigUtils(config, chainUtils) {
4922
4925
  return {
@@ -4977,7 +4980,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4977
4980
  }
4978
4981
  }
4979
4982
  config.devServer && rslog_index_js_namespaceObject.logger.warn(`[rsbuild:config] Find invalid Rspack config: "${index_js_default().yellow('devServer')}". Note that Rspack's "devServer" config is not supported by Rsbuild. You can use Rsbuild's "dev" config to configure the Rsbuild dev server.`);
4980
- }(rspackConfig = await modifyRspackConfig(context, rspackConfig, await getConfigUtils(rspackConfig, chainUtils))), rspackConfig;
4983
+ }(rspackConfig = await modifyRspackConfig(context, rspackConfig, chainUtils)), rspackConfig;
4981
4984
  }
4982
4985
  async function modifyRsbuildConfig(context) {
4983
4986
  rslog_index_js_namespaceObject.logger.debug('modify Rsbuild config');
@@ -5796,7 +5799,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
5796
5799
  let currentModuleScope = this.createModuleScope(this.getRequire(), m, file), args = Object.keys(currentModuleScope), argValues = args.map((arg)=>currentModuleScope[arg]), code = `(function(${args.join(', ')}) {
5797
5800
  ${file.content}
5798
5801
  })`;
5799
- return this.preExecute(code, file), (this._options.runInNewContext ? external_node_vm_default().runInNewContext(code, this.globalContext, file.path) : external_node_vm_default().runInThisContext(code, file.path)).call(m.exports, ...argValues), this.postExecute(m, file), m.exports;
5802
+ this.preExecute(code, file);
5803
+ let dynamicImport = Function('specifier', 'return import(specifier)');
5804
+ return external_node_vm_default().runInThisContext(code, {
5805
+ filename: file.path,
5806
+ importModuleDynamically: async (specifier)=>await dynamicImport(specifier)
5807
+ }).call(m.exports, ...argValues), this.postExecute(m, file), m.exports;
5800
5808
  };
5801
5809
  }
5802
5810
  }
@@ -6242,7 +6250,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6242
6250
  }) : Promise.resolve(), startCompile = async ()=>{
6243
6251
  let compiler = customCompiler || await createCompiler();
6244
6252
  if (!compiler) throw Error('[rsbuild:server] Failed to get compiler instance.');
6245
- let publicPaths = isMultiCompiler(compiler) ? compiler.compilers.map(getPublicPathFromCompiler) : [
6253
+ let publicPaths = helpers_isMultiCompiler(compiler) ? compiler.compilers.map(getPublicPathFromCompiler) : [
6246
6254
  getPublicPathFromCompiler(compiler)
6247
6255
  ], compilerDevMiddleware = new CompilerDevMiddleware({
6248
6256
  dev: devConfig,
@@ -6254,7 +6262,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6254
6262
  compiler,
6255
6263
  environments: options.context.environments
6256
6264
  });
6257
- return await compilerDevMiddleware.init(), outputFileSystem = (isMultiCompiler(compiler) ? compiler.compilers[0].outputFileSystem : compiler.outputFileSystem) || external_node_fs_default(), {
6265
+ return await compilerDevMiddleware.init(), outputFileSystem = (helpers_isMultiCompiler(compiler) ? compiler.compilers[0].outputFileSystem : compiler.outputFileSystem) || external_node_fs_default(), {
6258
6266
  middleware: compilerDevMiddleware.middleware,
6259
6267
  sockWrite: (...args)=>compilerDevMiddleware.sockWrite(...args),
6260
6268
  onUpgrade: (...args)=>compilerDevMiddleware.upgrade(...args),
@@ -6403,7 +6411,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6403
6411
  bundlerConfigs: rspackConfigs,
6404
6412
  environments: context.environments
6405
6413
  }), !await isSatisfyRspackVersion(core_namespaceObject.rspack.rspackVersion)) throw Error(`[rsbuild] The current Rspack version does not meet the requirements, the minimum supported version of Rspack is ${index_js_default().green(rspackMinVersion)}`);
6406
- let compiler = 1 === rspackConfigs.length ? (0, core_namespaceObject.rspack)(rspackConfigs[0]) : (0, core_namespaceObject.rspack)(rspackConfigs), isVersionLogged = !1, isCompiling = !1, logRspackVersion = ()=>{
6414
+ let isMultiCompiler = rspackConfigs.length > 1, compiler = isMultiCompiler ? (0, core_namespaceObject.rspack)(rspackConfigs) : (0, core_namespaceObject.rspack)(rspackConfigs[0]), isVersionLogged = !1, isCompiling = !1, logRspackVersion = ()=>{
6407
6415
  isVersionLogged || (rslog_index_js_namespaceObject.logger.debug(`use Rspack v${core_namespaceObject.rspack.rspackVersion}`), isVersionLogged = !0);
6408
6416
  };
6409
6417
  compiler.hooks.watchRun.tap('rsbuild:compiling', (compiler)=>{
@@ -6432,13 +6440,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6432
6440
  ...statsOptions
6433
6441
  }), printTime = (c, index)=>{
6434
6442
  if (c.time) {
6435
- let time = prettyTime(c.time / 1000), { name } = rspackConfigs[index], suffix = name ? index_js_default().gray(` (${name})`) : '';
6443
+ let time = prettyTime(c.time / 1000), { name } = rspackConfigs[index], suffix = name && isMultiCompiler ? index_js_default().gray(` (${name})`) : '';
6436
6444
  rslog_index_js_namespaceObject.logger.ready(`built in ${time}${suffix}`);
6437
6445
  }
6438
6446
  }, hasErrors = stats.hasErrors();
6439
6447
  if (!hasErrors) {
6440
6448
  var _statsJson_children;
6441
- rspackConfigs.length > 1 && (null === (_statsJson_children = statsJson.children) || void 0 === _statsJson_children ? void 0 : _statsJson_children.length) ? statsJson.children.forEach((c, index)=>{
6449
+ isMultiCompiler && (null === (_statsJson_children = statsJson.children) || void 0 === _statsJson_children ? void 0 : _statsJson_children.length) ? statsJson.children.forEach((c, index)=>{
6442
6450
  printTime(c, index);
6443
6451
  }) : printTime(statsJson, 0);
6444
6452
  }
@@ -7424,12 +7432,12 @@ ${section.body}` : section.body).join("\n\n"));
7424
7432
  }
7425
7433
  }(), process.title = 'rsbuild-node';
7426
7434
  let { npm_execpath } = process.env;
7427
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.17\n`);
7435
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.18\n`);
7428
7436
  }();
7429
7437
  try {
7430
7438
  !function() {
7431
7439
  let cli = cac_dist('rsbuild');
7432
- cli.help(), cli.version("1.2.17"), applyCommonOptions(cli);
7440
+ cli.help(), cli.version("1.2.18"), applyCommonOptions(cli);
7433
7441
  let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
7434
7442
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
7435
7443
  try {
@@ -7480,7 +7488,7 @@ ${section.body}` : section.body).join("\n\n"));
7480
7488
  rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
7481
7489
  }
7482
7490
  }
7483
- let src_rslib_entry_version = "1.2.17";
7491
+ let src_rslib_entry_version = "1.2.18";
7484
7492
  })();
7485
7493
  var __webpack_export_target__ = exports;
7486
7494
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
package/dist/index.js CHANGED
@@ -1203,7 +1203,7 @@ let getAllStatsErrors = (statsData)=>{
1203
1203
  return statsData.warningsCount && (null === (_statsData_warnings = statsData.warnings) || void 0 === _statsData_warnings ? void 0 : _statsData_warnings.length) === 0 ? null === (_statsData_children = statsData.children) || void 0 === _statsData_children ? void 0 : _statsData_children.reduce((warnings, curr)=>warnings.concat(curr.warnings || []), []) : statsData.warnings;
1204
1204
  };
1205
1205
  function getStatsOptions(compiler) {
1206
- if (isMultiCompiler(compiler)) return {
1206
+ if (helpers_isMultiCompiler(compiler)) return {
1207
1207
  children: compiler.compilers.map((compiler)=>compiler.options ? compiler.options.stats : void 0)
1208
1208
  };
1209
1209
  let { stats } = compiler.options;
@@ -1302,8 +1302,8 @@ function getFilename(config, type, isProd, isServer) {
1302
1302
  }
1303
1303
  }
1304
1304
  let applyToCompiler = (compiler, apply)=>{
1305
- isMultiCompiler(compiler) ? compiler.compilers.forEach(apply) : apply(compiler, 0);
1306
- }, upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', isURL = (str)=>str.startsWith('http') || str.startsWith('//:'), createVirtualModule = (content)=>`data:text/javascript,${content}`, isMultiCompiler = (compiler)=>'compilers' in compiler && Array.isArray(compiler.compilers);
1305
+ helpers_isMultiCompiler(compiler) ? compiler.compilers.forEach(apply) : apply(compiler, 0);
1306
+ }, upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', isURL = (str)=>str.startsWith('http') || str.startsWith('//:'), createVirtualModule = (content)=>`data:text/javascript,${content}`, helpers_isMultiCompiler = (compiler)=>'compilers' in compiler && Array.isArray(compiler.compilers);
1307
1307
  function pick(obj, keys) {
1308
1308
  return keys.reduce((ret, key)=>(void 0 !== obj[key] && (ret[key] = obj[key]), ret), {});
1309
1309
  }
@@ -2045,7 +2045,7 @@ function createAsyncHook() {
2045
2045
  }
2046
2046
  let onBeforeCompile = ({ compiler, beforeCompile, beforeEnvironmentCompiler, isWatch })=>{
2047
2047
  let name = 'rsbuild:beforeCompile';
2048
- if (isMultiCompiler(compiler)) {
2048
+ if (helpers_isMultiCompiler(compiler)) {
2049
2049
  let waitBeforeCompileDone;
2050
2050
  let { compilers } = compiler, doneCompilers = 0;
2051
2051
  for(let index = 0; index < compilers.length; index++){
@@ -2060,7 +2060,7 @@ let onBeforeCompile = ({ compiler, beforeCompile, beforeEnvironmentCompiler, isW
2060
2060
  await (null == beforeCompile ? void 0 : beforeCompile()), await beforeEnvironmentCompiler(0);
2061
2061
  });
2062
2062
  }, onCompileDone = ({ compiler, onDone, onEnvironmentDone, MultiStatsCtor })=>{
2063
- if (isMultiCompiler(compiler)) {
2063
+ if (helpers_isMultiCompiler(compiler)) {
2064
2064
  let { compilers } = compiler, compilerStats = [], doneCompilers = 0;
2065
2065
  for(let index = 0; index < compilers.length; index++){
2066
2066
  let compiler = compilers[index], compilerIndex = index, compilerDone = !1;
@@ -2284,7 +2284,7 @@ async function updateEnvironmentContext(context, configs) {
2284
2284
  async function createContext(options, userConfig, bundlerType) {
2285
2285
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
2286
2286
  return {
2287
- version: "1.2.17",
2287
+ version: "1.2.18",
2288
2288
  rootPath,
2289
2289
  distPath: '',
2290
2290
  cachePath,
@@ -4791,22 +4791,25 @@ async function inspectConfig({ context, pluginManager, rsbuildOptions, bundlerCo
4791
4791
  };
4792
4792
  }
4793
4793
  var dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
4794
- async function modifyRspackConfig(context, rspackConfig, utils) {
4794
+ async function modifyRspackConfig(context, rspackConfig, chainUtils) {
4795
4795
  var _utils_environment_config_tools;
4796
4796
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('modify Rspack config');
4797
- let [modifiedConfig] = await context.hooks.modifyRspackConfig.callChain({
4797
+ let currentConfig = rspackConfig, proxiedConfig = new Proxy({}, {
4798
+ get: (_, prop)=>currentConfig[prop],
4799
+ set: (_, prop, value)=>(currentConfig[prop] = value, !0)
4800
+ }), utils = await getConfigUtils(proxiedConfig, chainUtils);
4801
+ return [currentConfig] = await context.hooks.modifyRspackConfig.callChain({
4798
4802
  environment: utils.environment.name,
4799
4803
  args: [
4800
4804
  rspackConfig,
4801
4805
  utils
4802
4806
  ]
4803
- });
4804
- return (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.rspack) && (modifiedConfig = await reduceConfigsAsyncWithContext({
4805
- initial: modifiedConfig,
4807
+ }), (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.rspack) && (currentConfig = await reduceConfigsAsyncWithContext({
4808
+ initial: currentConfig,
4806
4809
  config: utils.environment.config.tools.rspack,
4807
4810
  ctx: utils,
4808
- mergeFn: utils.mergeConfig
4809
- })), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('modify Rspack config done'), modifiedConfig;
4811
+ mergeFn: (...args)=>currentConfig = utils.mergeConfig.call(utils, args)
4812
+ })), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('modify Rspack config done'), currentConfig;
4810
4813
  }
4811
4814
  async function getConfigUtils(config, chainUtils) {
4812
4815
  return {
@@ -4867,7 +4870,7 @@ async function generateRspackConfig({ target, context, environment }) {
4867
4870
  }
4868
4871
  }
4869
4872
  config.devServer && __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.warn(`[rsbuild:config] Find invalid Rspack config: "${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow('devServer')}". Note that Rspack's "devServer" config is not supported by Rsbuild. You can use Rsbuild's "dev" config to configure the Rsbuild dev server.`);
4870
- }(rspackConfig = await modifyRspackConfig(context, rspackConfig, await getConfigUtils(rspackConfig, chainUtils))), rspackConfig;
4873
+ }(rspackConfig = await modifyRspackConfig(context, rspackConfig, chainUtils)), rspackConfig;
4871
4874
  }
4872
4875
  async function modifyRsbuildConfig(context) {
4873
4876
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('modify Rsbuild config');
@@ -5681,7 +5684,12 @@ class CommonJsRunner extends BasicRunner {
5681
5684
  let currentModuleScope = this.createModuleScope(this.getRequire(), m, file), args = Object.keys(currentModuleScope), argValues = args.map((arg)=>currentModuleScope[arg]), code = `(function(${args.join(', ')}) {
5682
5685
  ${file.content}
5683
5686
  })`;
5684
- return this.preExecute(code, file), (this._options.runInNewContext ? __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.runInNewContext(code, this.globalContext, file.path) : __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.runInThisContext(code, file.path)).call(m.exports, ...argValues), this.postExecute(m, file), m.exports;
5687
+ this.preExecute(code, file);
5688
+ let dynamicImport = Function('specifier', 'return import(specifier)');
5689
+ return __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.runInThisContext(code, {
5690
+ filename: file.path,
5691
+ importModuleDynamically: async (specifier)=>await dynamicImport(specifier)
5692
+ }).call(m.exports, ...argValues), this.postExecute(m, file), m.exports;
5685
5693
  };
5686
5694
  }
5687
5695
  }
@@ -6124,7 +6132,7 @@ async function devServer_createDevServer(options, createCompiler, config, { comp
6124
6132
  }) : Promise.resolve(), startCompile = async ()=>{
6125
6133
  let compiler = customCompiler || await createCompiler();
6126
6134
  if (!compiler) throw Error('[rsbuild:server] Failed to get compiler instance.');
6127
- let publicPaths = isMultiCompiler(compiler) ? compiler.compilers.map(getPublicPathFromCompiler) : [
6135
+ let publicPaths = helpers_isMultiCompiler(compiler) ? compiler.compilers.map(getPublicPathFromCompiler) : [
6128
6136
  getPublicPathFromCompiler(compiler)
6129
6137
  ], compilerDevMiddleware = new CompilerDevMiddleware({
6130
6138
  dev: devConfig,
@@ -6136,7 +6144,7 @@ async function devServer_createDevServer(options, createCompiler, config, { comp
6136
6144
  compiler,
6137
6145
  environments: options.context.environments
6138
6146
  });
6139
- return await compilerDevMiddleware.init(), outputFileSystem = (isMultiCompiler(compiler) ? compiler.compilers[0].outputFileSystem : compiler.outputFileSystem) || __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default, {
6147
+ return await compilerDevMiddleware.init(), outputFileSystem = (helpers_isMultiCompiler(compiler) ? compiler.compilers[0].outputFileSystem : compiler.outputFileSystem) || __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default, {
6140
6148
  middleware: compilerDevMiddleware.middleware,
6141
6149
  sockWrite: (...args)=>compilerDevMiddleware.sockWrite(...args),
6142
6150
  onUpgrade: (...args)=>compilerDevMiddleware.upgrade(...args),
@@ -6285,7 +6293,7 @@ async function createCompiler_createCompiler(options) {
6285
6293
  bundlerConfigs: rspackConfigs,
6286
6294
  environments: context.environments
6287
6295
  }), !await isSatisfyRspackVersion(__WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.rspackVersion)) throw Error(`[rsbuild] The current Rspack version does not meet the requirements, the minimum supported version of Rspack is ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green(rspackMinVersion)}`);
6288
- let compiler = 1 === rspackConfigs.length ? (0, __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack)(rspackConfigs[0]) : (0, __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack)(rspackConfigs), isVersionLogged = !1, isCompiling = !1, logRspackVersion = ()=>{
6296
+ let isMultiCompiler = rspackConfigs.length > 1, compiler = isMultiCompiler ? (0, __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack)(rspackConfigs) : (0, __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack)(rspackConfigs[0]), isVersionLogged = !1, isCompiling = !1, logRspackVersion = ()=>{
6289
6297
  isVersionLogged || (__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug(`use Rspack v${__WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.rspackVersion}`), isVersionLogged = !0);
6290
6298
  };
6291
6299
  compiler.hooks.watchRun.tap('rsbuild:compiling', (compiler)=>{
@@ -6314,13 +6322,13 @@ async function createCompiler_createCompiler(options) {
6314
6322
  ...statsOptions
6315
6323
  }), printTime = (c, index)=>{
6316
6324
  if (c.time) {
6317
- let time = prettyTime(c.time / 1000), { name } = rspackConfigs[index], suffix = name ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.gray(` (${name})`) : '';
6325
+ let time = prettyTime(c.time / 1000), { name } = rspackConfigs[index], suffix = name && isMultiCompiler ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.gray(` (${name})`) : '';
6318
6326
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.ready(`built in ${time}${suffix}`);
6319
6327
  }
6320
6328
  }, hasErrors = stats.hasErrors();
6321
6329
  if (!hasErrors) {
6322
6330
  var _statsJson_children;
6323
- rspackConfigs.length > 1 && (null === (_statsJson_children = statsJson.children) || void 0 === _statsJson_children ? void 0 : _statsJson_children.length) ? statsJson.children.forEach((c, index)=>{
6331
+ isMultiCompiler && (null === (_statsJson_children = statsJson.children) || void 0 === _statsJson_children ? void 0 : _statsJson_children.length) ? statsJson.children.forEach((c, index)=>{
6324
6332
  printTime(c, index);
6325
6333
  }) : printTime(statsJson, 0);
6326
6334
  }
@@ -7305,12 +7313,12 @@ async function runCLI() {
7305
7313
  }
7306
7314
  }(), process.title = 'rsbuild-node';
7307
7315
  let { npm_execpath } = process.env;
7308
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.17\n`);
7316
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.18\n`);
7309
7317
  }();
7310
7318
  try {
7311
7319
  !function() {
7312
7320
  let cli = cac_dist('rsbuild');
7313
- cli.help(), cli.version("1.2.17"), applyCommonOptions(cli);
7321
+ cli.help(), cli.version("1.2.18"), applyCommonOptions(cli);
7314
7322
  let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
7315
7323
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
7316
7324
  try {
@@ -7361,6 +7369,6 @@ async function runCLI() {
7361
7369
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
7362
7370
  }
7363
7371
  }
7364
- let src_version = "1.2.17";
7372
+ let src_version = "1.2.18";
7365
7373
  var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
7366
7374
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
@@ -18,3 +18,4 @@ export { PLUGIN_SWC_NAME, PLUGIN_CSS_NAME } from './constants';
18
18
  export type { AppIcon, AppIconItem, AliasStrategy, Build, BuildOptions, BundlerPluginInstance, Charset, ClientConfig, CliShortcut, CleanDistPath, CleanDistPathObject, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, 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, InternalContext, LegalComments, ManifestData, ManifestConfig, ManifestObjectConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyRsbuildConfigFn, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigFn, ModifyWebpackConfigUtils, ModuleFederationConfig, MergedEnvironmentConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterEnvironmentCompileFn, OnBeforeEnvironmentCompileFn, OnCloseBuildFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PreloadIncludeType, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreviewOptions, PreconnectOption, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PrintUrls, PublicDir, PublicDirOptions, ProgressBarConfig, RequestHandler, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildProviderHelpers, RsbuildTarget, RspackChain, RspackRule, StartDevServerOptions, SriOptions, SriAlgorithm, ScriptInject, ScriptLoading, SecurityConfig, SourceMap, SetupMiddlewaresFn, SetupMiddlewaresServer, ServerConfig, SourceConfig, SplitChunks, StyleLoaderOptions, TransformContext, TransformDescriptor, ToolsConfig, TransformFn, TransformHandler, TransformImport, WatchFiles, } from './types';
19
19
  export type { ChainIdentifier } from './configChain';
20
20
  export type { RsbuildDevServer } from './server/devServer';
21
+ export type { StartServerResult } from './server/helper';
@@ -3,7 +3,6 @@ import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObjec
3
3
  export interface IBasicRunnerOptions {
4
4
  name: string;
5
5
  isBundleOutput: (modulePath: string) => boolean;
6
- runInNewContext?: boolean;
7
6
  readFileSync: (path: string) => string;
8
7
  dist: string;
9
8
  compilerOptions: CompilerOptions;
@@ -62,9 +62,27 @@ export type Build = (options?: BuildOptions) => Promise<{
62
62
  stats?: Rspack.Stats | Rspack.MultiStats;
63
63
  }>;
64
64
  export type InspectConfigOptions = {
65
+ /**
66
+ * Inspect the config in the specified mode.
67
+ * Available options: 'development' or 'production'.
68
+ * @default 'development'
69
+ */
65
70
  mode?: RsbuildMode;
71
+ /**
72
+ * Enables verbose mode to display the complete function
73
+ * content in the configuration.
74
+ * @default false
75
+ */
66
76
  verbose?: boolean;
77
+ /**
78
+ * Specify the output path for inspection results.
79
+ * @default 'output.distPath.root'
80
+ */
67
81
  outputPath?: string;
82
+ /**
83
+ * Whether to write the inspection results to disk.
84
+ * @default false
85
+ */
68
86
  writeToDisk?: boolean;
69
87
  };
70
88
  export type InspectConfigResult<B extends 'rspack' | 'webpack' = 'rspack'> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
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.2.7",
49
+ "@rspack/core": "1.2.8",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.15",
52
52
  "core-js": "~3.41.0",