@rsbuild/core 1.5.0-beta.1 → 1.5.0-beta.2

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
- 4787: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 9613: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(5933);
5
+ const loader = __nccwpck_require__(1703);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(6616).defaultGetLocalIdent;
8
+ __nccwpck_require__(2114).defaultGetLocalIdent;
9
9
  },
10
- 5933: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 1703: (__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__(7042);
16
- var _utils = __nccwpck_require__(6616);
15
+ var _plugins = __nccwpck_require__(6124);
16
+ var _utils = __nccwpck_require__(2114);
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
- 7042: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 6124: (__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,22 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(6001),
261
+ __nccwpck_require__(1207),
262
262
  );
263
263
  var _postcssIcssParser = _interopRequireDefault(
264
- __nccwpck_require__(5352),
264
+ __nccwpck_require__(3242),
265
265
  );
266
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(2239));
266
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4893));
267
267
  function _interopRequireDefault(obj) {
268
268
  return obj && obj.__esModule ? obj : { default: obj };
269
269
  }
270
270
  },
271
- 5352: (__unused_webpack_module, exports, __nccwpck_require__) => {
271
+ 3242: (__unused_webpack_module, exports, __nccwpck_require__) => {
272
272
  "use strict";
273
273
  Object.defineProperty(exports, "__esModule", { value: true });
274
274
  exports["default"] = void 0;
275
275
  var _icssUtils = __nccwpck_require__(9028);
276
- var _utils = __nccwpck_require__(6616);
276
+ var _utils = __nccwpck_require__(2114);
277
277
  const plugin = (options = {}) => ({
278
278
  postcssPlugin: "postcss-icss-parser",
279
279
  async OnceExit(root) {
@@ -372,14 +372,14 @@
372
372
  plugin.postcss = true;
373
373
  var _default = (exports["default"] = plugin);
374
374
  },
375
- 6001: (__unused_webpack_module, exports, __nccwpck_require__) => {
375
+ 1207: (__unused_webpack_module, exports, __nccwpck_require__) => {
376
376
  "use strict";
377
377
  Object.defineProperty(exports, "__esModule", { value: true });
378
378
  exports["default"] = void 0;
379
379
  var _postcssValueParser = _interopRequireDefault(
380
380
  __nccwpck_require__(2948),
381
381
  );
382
- var _utils = __nccwpck_require__(6616);
382
+ var _utils = __nccwpck_require__(2114);
383
383
  function _interopRequireDefault(obj) {
384
384
  return obj && obj.__esModule ? obj : { default: obj };
385
385
  }
@@ -684,14 +684,14 @@
684
684
  plugin.postcss = true;
685
685
  var _default = (exports["default"] = plugin);
686
686
  },
687
- 2239: (__unused_webpack_module, exports, __nccwpck_require__) => {
687
+ 4893: (__unused_webpack_module, exports, __nccwpck_require__) => {
688
688
  "use strict";
689
689
  Object.defineProperty(exports, "__esModule", { value: true });
690
690
  exports["default"] = void 0;
691
691
  var _postcssValueParser = _interopRequireDefault(
692
692
  __nccwpck_require__(2948),
693
693
  );
694
- var _utils = __nccwpck_require__(6616);
694
+ var _utils = __nccwpck_require__(2114);
695
695
  function _interopRequireDefault(obj) {
696
696
  return obj && obj.__esModule ? obj : { default: obj };
697
697
  }
@@ -1034,7 +1034,7 @@
1034
1034
  plugin.postcss = true;
1035
1035
  var _default = (exports["default"] = plugin);
1036
1036
  },
1037
- 6616: (__unused_webpack_module, exports, __nccwpck_require__) => {
1037
+ 2114: (__unused_webpack_module, exports, __nccwpck_require__) => {
1038
1038
  "use strict";
1039
1039
  Object.defineProperty(exports, "__esModule", { value: true });
1040
1040
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8098,6 +8098,6 @@
8098
8098
  }
8099
8099
  if (typeof __nccwpck_require__ !== "undefined")
8100
8100
  __nccwpck_require__.ab = __dirname + "/";
8101
- var __webpack_exports__ = __nccwpck_require__(4787);
8101
+ var __webpack_exports__ = __nccwpck_require__(9613);
8102
8102
  module.exports = __webpack_exports__;
8103
8103
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 58: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(576)["default"];
4
+ 132: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(354)["default"];
6
6
  },
7
- 576: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 354: (__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__(353);
12
+ var _utils = __nccwpck_require__(435);
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
- 353: (module, exports, __nccwpck_require__) => {
182
+ 435: (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__(58);
719
+ var __webpack_exports__ = __nccwpck_require__(132);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -4439,15 +4439,15 @@
4439
4439
  return a.start - b.start;
4440
4440
  }
4441
4441
  },
4442
- 9409: (module, __unused_webpack_exports, __nccwpck_require__) => {
4442
+ 9108: (module, __unused_webpack_exports, __nccwpck_require__) => {
4443
4443
  "use strict";
4444
4444
  const { logger } = __nccwpck_require__(8679);
4445
- const middleware = __nccwpck_require__(893);
4446
- const getFilenameFromUrl = __nccwpck_require__(333);
4447
- const setupHooks = __nccwpck_require__(1792);
4448
- const setupWriteToDisk = __nccwpck_require__(5691);
4449
- const setupOutputFileSystem = __nccwpck_require__(272);
4450
- const ready = __nccwpck_require__(380);
4445
+ const middleware = __nccwpck_require__(7066);
4446
+ const getFilenameFromUrl = __nccwpck_require__(3838);
4447
+ const setupHooks = __nccwpck_require__(6003);
4448
+ const setupWriteToDisk = __nccwpck_require__(3924);
4449
+ const setupOutputFileSystem = __nccwpck_require__(4669);
4450
+ const ready = __nccwpck_require__(1601);
4451
4451
  const noop = () => {};
4452
4452
  function wdm(compiler, options = {}) {
4453
4453
  const context = {
@@ -4512,15 +4512,15 @@
4512
4512
  }
4513
4513
  module.exports = wdm;
4514
4514
  },
4515
- 893: (module, __unused_webpack_exports, __nccwpck_require__) => {
4515
+ 7066: (module, __unused_webpack_exports, __nccwpck_require__) => {
4516
4516
  "use strict";
4517
4517
  const mrmime = __nccwpck_require__(8311);
4518
4518
  const { logger } = __nccwpck_require__(8679);
4519
4519
  const onFinishedStream = __nccwpck_require__(21);
4520
- const getFilenameFromUrl = __nccwpck_require__(333);
4521
- const ready = __nccwpck_require__(380);
4522
- const parseTokenList = __nccwpck_require__(4955);
4523
- const memorize = __nccwpck_require__(4917);
4520
+ const getFilenameFromUrl = __nccwpck_require__(3838);
4521
+ const ready = __nccwpck_require__(1601);
4522
+ const parseTokenList = __nccwpck_require__(6964);
4523
+ const memorize = __nccwpck_require__(7242);
4524
4524
  async function getEtag(stat) {
4525
4525
  const mtime = stat.mtime.getTime().toString(16);
4526
4526
  const size = stat.size.toString(16);
@@ -4612,7 +4612,7 @@
4612
4612
  return;
4613
4613
  }
4614
4614
  function sendError(status, options) {
4615
- const escapeHtml = __nccwpck_require__(6849);
4615
+ const escapeHtml = __nccwpck_require__(5134);
4616
4616
  const content = statuses[status] || String(status);
4617
4617
  const document = Buffer.from(
4618
4618
  `<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>${escapeHtml(content)}</pre>\n</body>\n</html>`,
@@ -4921,7 +4921,7 @@
4921
4921
  }
4922
4922
  module.exports = wrapper;
4923
4923
  },
4924
- 6849: (module) => {
4924
+ 5134: (module) => {
4925
4925
  "use strict";
4926
4926
  const matchHtmlRegExp = /["'&<>]/;
4927
4927
  function escapeHtml(string) {
@@ -4966,13 +4966,13 @@
4966
4966
  }
4967
4967
  module.exports = escapeHtml;
4968
4968
  },
4969
- 333: (module, __unused_webpack_exports, __nccwpck_require__) => {
4969
+ 3838: (module, __unused_webpack_exports, __nccwpck_require__) => {
4970
4970
  "use strict";
4971
4971
  const path = __nccwpck_require__(6928);
4972
4972
  const { parse } = __nccwpck_require__(7016);
4973
4973
  const querystring = __nccwpck_require__(3480);
4974
- const getPaths = __nccwpck_require__(5367);
4975
- const memorize = __nccwpck_require__(4917);
4974
+ const getPaths = __nccwpck_require__(9960);
4975
+ const memorize = __nccwpck_require__(7242);
4976
4976
  const memoizedParse = memorize(parse, undefined, (value) => {
4977
4977
  if (value.pathname) {
4978
4978
  value.pathname = decode(value.pathname);
@@ -5055,7 +5055,7 @@
5055
5055
  }
5056
5056
  module.exports = getFilenameFromUrl;
5057
5057
  },
5058
- 5367: (module) => {
5058
+ 9960: (module) => {
5059
5059
  "use strict";
5060
5060
  function getPaths(context) {
5061
5061
  const { stats, options } = context;
@@ -5076,7 +5076,7 @@
5076
5076
  }
5077
5077
  module.exports = getPaths;
5078
5078
  },
5079
- 4917: (module) => {
5079
+ 7242: (module) => {
5080
5080
  "use strict";
5081
5081
  const cacheStore = new WeakMap();
5082
5082
  function memorize(fn, { cache = new Map() } = {}, callback) {
@@ -5098,7 +5098,7 @@
5098
5098
  }
5099
5099
  module.exports = memorize;
5100
5100
  },
5101
- 4955: (module) => {
5101
+ 6964: (module) => {
5102
5102
  "use strict";
5103
5103
  function parseTokenList(str) {
5104
5104
  let end = 0;
@@ -5131,7 +5131,7 @@
5131
5131
  }
5132
5132
  module.exports = parseTokenList;
5133
5133
  },
5134
- 380: (module, __unused_webpack_exports, __nccwpck_require__) => {
5134
+ 1601: (module, __unused_webpack_exports, __nccwpck_require__) => {
5135
5135
  "use strict";
5136
5136
  const { logger } = __nccwpck_require__(8679);
5137
5137
  function ready(context, callback, req) {
@@ -5147,7 +5147,7 @@
5147
5147
  }
5148
5148
  module.exports = ready;
5149
5149
  },
5150
- 1792: (module) => {
5150
+ 6003: (module) => {
5151
5151
  "use strict";
5152
5152
  function setupHooks(context) {
5153
5153
  function invalid() {
@@ -5175,7 +5175,7 @@
5175
5175
  }
5176
5176
  module.exports = setupHooks;
5177
5177
  },
5178
- 272: (module, __unused_webpack_exports, __nccwpck_require__) => {
5178
+ 4669: (module, __unused_webpack_exports, __nccwpck_require__) => {
5179
5179
  "use strict";
5180
5180
  const memfs = __nccwpck_require__(8672);
5181
5181
  function setupOutputFileSystem(context) {
@@ -5202,7 +5202,7 @@
5202
5202
  }
5203
5203
  module.exports = setupOutputFileSystem;
5204
5204
  },
5205
- 5691: (module, __unused_webpack_exports, __nccwpck_require__) => {
5205
+ 3924: (module, __unused_webpack_exports, __nccwpck_require__) => {
5206
5206
  "use strict";
5207
5207
  const fs = __nccwpck_require__(9896);
5208
5208
  const path = __nccwpck_require__(6928);
@@ -6195,6 +6195,6 @@
6195
6195
  }
6196
6196
  if (typeof __nccwpck_require__ !== "undefined")
6197
6197
  __nccwpck_require__.ab = __dirname + "/";
6198
- var __webpack_exports__ = __nccwpck_require__(9409);
6198
+ var __webpack_exports__ = __nccwpck_require__(9108);
6199
6199
  module.exports = __webpack_exports__;
6200
6200
  })();
@@ -1,16 +1,16 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 368: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- const loader = __nccwpck_require__(238);
4
+ 321: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ const loader = __nccwpck_require__(139);
6
6
  module.exports = loader.default;
7
7
  },
8
- 238: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
+ 139: (__unused_webpack_module, exports, __nccwpck_require__) => {
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports["default"] = void 0;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(928));
12
- var _utils = __nccwpck_require__(695);
13
- var _options = _interopRequireDefault(__nccwpck_require__(771));
12
+ var _utils = __nccwpck_require__(190);
13
+ var _options = _interopRequireDefault(__nccwpck_require__(242));
14
14
  function _interopRequireDefault(obj) {
15
15
  return obj && obj.__esModule ? obj : { default: obj };
16
16
  }
@@ -104,7 +104,7 @@
104
104
  };
105
105
  var _default = (exports["default"] = loader);
106
106
  },
107
- 425: (module) => {
107
+ 136: (module) => {
108
108
  function isEqualLocals(a, b, isNamedExport) {
109
109
  if ((!a && b) || (a && !b)) {
110
110
  return false;
@@ -130,7 +130,7 @@
130
130
  }
131
131
  module.exports = isEqualLocals;
132
132
  },
133
- 695: (__unused_webpack_module, exports, __nccwpck_require__) => {
133
+ 190: (__unused_webpack_module, exports, __nccwpck_require__) => {
134
134
  Object.defineProperty(exports, "__esModule", { value: true });
135
135
  exports.getExportLazyStyleCode = getExportLazyStyleCode;
136
136
  exports.getExportStyleCode = getExportStyleCode;
@@ -151,7 +151,7 @@
151
151
  exports.getdomAPI = getdomAPI;
152
152
  exports.stringifyRequest = stringifyRequest;
153
153
  var _path = _interopRequireDefault(__nccwpck_require__(928));
154
- var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(425));
154
+ var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(136));
155
155
  function _interopRequireDefault(obj) {
156
156
  return obj && obj.__esModule ? obj : { default: obj };
157
157
  }
@@ -394,7 +394,7 @@
394
394
  928: (module) => {
395
395
  module.exports = require("path");
396
396
  },
397
- 771: (module) => {
397
+ 242: (module) => {
398
398
  module.exports = JSON.parse(
399
399
  '{"title":"Style Loader options","type":"object","properties":{"injectType":{"description":"Allows to setup how styles will be injected into DOM.","link":"https://github.com/webpack-contrib/style-loader#injecttype","enum":["styleTag","singletonStyleTag","autoStyleTag","lazyStyleTag","lazySingletonStyleTag","lazyAutoStyleTag","linkTag"]},"attributes":{"description":"Adds custom attributes to tag.","link":"https://github.com/webpack-contrib/style-loader#attributes","type":"object"},"insert":{"description":"Inserts `<style>`/`<link>` at the given position.","link":"https://github.com/webpack-contrib/style-loader#insert","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"base":{"description":"Sets module ID base for DLLPlugin.","link":"https://github.com/webpack-contrib/style-loader#base","type":"number"},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"styleTagTransform":{"description":"Transform tag and css when insert \'style\' tag into the DOM","link":"https://github.com/webpack-contrib/style-loader#styleTagTransform","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
400
400
  );
@@ -422,6 +422,6 @@
422
422
  }
423
423
  if (typeof __nccwpck_require__ !== "undefined")
424
424
  __nccwpck_require__.ab = __dirname + "/";
425
- var __webpack_exports__ = __nccwpck_require__(368);
425
+ var __webpack_exports__ = __nccwpck_require__(321);
426
426
  module.exports = __webpack_exports__;
427
427
  })();
package/dist/index.cjs CHANGED
@@ -3733,7 +3733,7 @@ ${section.body}` : section.body).join("\n\n"));
3733
3733
  async function createContext(options, userConfig) {
3734
3734
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3735
3735
  return {
3736
- version: "1.5.0-beta.1",
3736
+ version: "1.5.0-beta.2",
3737
3737
  rootPath,
3738
3738
  distPath: '',
3739
3739
  cachePath,
@@ -4463,9 +4463,13 @@ ${section.body}` : section.body).join("\n\n"));
4463
4463
  recursive: !0
4464
4464
  });
4465
4465
  }
4466
- await external_node_fs_default().promises.mkdir(cacheDirectory, {
4467
- recursive: !0
4468
- }), await external_node_fs_default().promises.writeFile(configFile, JSON.stringify(buildDependencies));
4466
+ try {
4467
+ await external_node_fs_default().promises.mkdir(cacheDirectory, {
4468
+ recursive: !0
4469
+ }), await external_node_fs_default().promises.writeFile(configFile, JSON.stringify(buildDependencies));
4470
+ } catch (e) {
4471
+ index_js_namespaceObject.logger.debug('failed to write the buildDependencies.json', e);
4472
+ }
4469
4473
  }
4470
4474
  async function getBuildDependencies(context, config, environmentContext, userBuildDependencies) {
4471
4475
  let rootPackageJson = (0, external_node_path_.join)(context.rootPath, 'package.json'), browserslistConfig = (0, external_node_path_.join)(context.rootPath, '.browserslistrc'), buildDependencies = {};
@@ -7623,6 +7627,8 @@ ${section.body}` : section.body).join("\n\n"));
7623
7627
  }
7624
7628
  }), isDev && config.dev.hmr && 'web' === target && chain.plugin(CHAIN_ID.PLUGIN.HMR).use(bundler.HotModuleReplacementPlugin), isDev && chain.output.devtoolModuleFilenameTemplate((info)=>toPosixPath(info.absoluteResourcePath)), 'rspack' === api.context.bundlerType && chain.experiments({
7625
7629
  ...chain.get('experiments'),
7630
+ lazyBarrel: !0,
7631
+ inlineEnum: !0,
7626
7632
  typeReexportsPresence: !0,
7627
7633
  rspackFuture: {
7628
7634
  bundlerInfo: {
@@ -8506,7 +8512,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
8506
8512
  rspackExperiments: {
8507
8513
  collectTypeScriptInfo: {
8508
8514
  typeExports: !0,
8509
- exportedEnum: !1
8515
+ exportedEnum: !0
8510
8516
  }
8511
8517
  }
8512
8518
  };
@@ -9365,12 +9371,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
9365
9371
  !function() {
9366
9372
  if (cli_argv.some((item)=>'--help' === item || '-h' === item)) return;
9367
9373
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9368
- index_js_namespaceObject.logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''} Rsbuild v1.5.0-beta.1\n`);
9374
+ index_js_namespaceObject.logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''} Rsbuild v1.5.0-beta.2\n`);
9369
9375
  }();
9370
9376
  try {
9371
9377
  !function() {
9372
9378
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9373
- cli.help(), cli.version("1.5.0-beta.1"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (jiti | native)', {
9379
+ cli.help(), cli.version("1.5.0-beta.2"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (jiti | native)', {
9374
9380
  default: 'jiti'
9375
9381
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9376
9382
  type: [
@@ -9428,7 +9434,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
9428
9434
  index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), index_js_namespaceObject.logger.error(err);
9429
9435
  }
9430
9436
  }
9431
- let src_version = "1.5.0-beta.1";
9437
+ let src_version = "1.5.0-beta.2";
9432
9438
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
9433
9439
  "PLUGIN_CSS_NAME",
9434
9440
  "PLUGIN_SWC_NAME",
package/dist/index.js CHANGED
@@ -3533,7 +3533,7 @@ async function updateEnvironmentContext(context, configs) {
3533
3533
  async function createContext(options, userConfig) {
3534
3534
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3535
3535
  return {
3536
- version: "1.5.0-beta.1",
3536
+ version: "1.5.0-beta.2",
3537
3537
  rootPath,
3538
3538
  distPath: '',
3539
3539
  cachePath,
@@ -4262,9 +4262,13 @@ async function validateWebpackCache(cacheDirectory, buildDependencies) {
4262
4262
  recursive: !0
4263
4263
  });
4264
4264
  }
4265
- await node_fs.promises.mkdir(cacheDirectory, {
4266
- recursive: !0
4267
- }), await node_fs.promises.writeFile(configFile, JSON.stringify(buildDependencies));
4265
+ try {
4266
+ await node_fs.promises.mkdir(cacheDirectory, {
4267
+ recursive: !0
4268
+ }), await node_fs.promises.writeFile(configFile, JSON.stringify(buildDependencies));
4269
+ } catch (e) {
4270
+ logger.debug('failed to write the buildDependencies.json', e);
4271
+ }
4268
4272
  }
4269
4273
  async function getBuildDependencies(context, config, environmentContext, userBuildDependencies) {
4270
4274
  let rootPackageJson = (0, external_node_path_.join)(context.rootPath, 'package.json'), browserslistConfig = (0, external_node_path_.join)(context.rootPath, '.browserslistrc'), buildDependencies = {};
@@ -7404,6 +7408,8 @@ async function createRsbuild(options = {}) {
7404
7408
  }
7405
7409
  }), isDev && config.dev.hmr && 'web' === target && chain.plugin(CHAIN_ID.PLUGIN.HMR).use(bundler.HotModuleReplacementPlugin), isDev && chain.output.devtoolModuleFilenameTemplate((info)=>toPosixPath(info.absoluteResourcePath)), 'rspack' === api.context.bundlerType && chain.experiments({
7406
7410
  ...chain.get('experiments'),
7411
+ lazyBarrel: !0,
7412
+ inlineEnum: !0,
7407
7413
  typeReexportsPresence: !0,
7408
7414
  rspackFuture: {
7409
7415
  bundlerInfo: {
@@ -8285,7 +8291,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
8285
8291
  rspackExperiments: {
8286
8292
  collectTypeScriptInfo: {
8287
8293
  typeExports: !0,
8288
- exportedEnum: !1
8294
+ exportedEnum: !0
8289
8295
  }
8290
8296
  }
8291
8297
  };
@@ -9143,12 +9149,12 @@ function runCLI() {
9143
9149
  !function() {
9144
9150
  if (cli_argv.some((item)=>'--help' === item || '-h' === item)) return;
9145
9151
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9146
- logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''} Rsbuild v1.5.0-beta.1\n`);
9152
+ logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''} Rsbuild v1.5.0-beta.2\n`);
9147
9153
  }();
9148
9154
  try {
9149
9155
  !function() {
9150
9156
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9151
- cli.help(), cli.version("1.5.0-beta.1"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (jiti | native)', {
9157
+ cli.help(), cli.version("1.5.0-beta.2"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (jiti | native)', {
9152
9158
  default: 'jiti'
9153
9159
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9154
9160
  type: [
@@ -9206,5 +9212,5 @@ function runCLI() {
9206
9212
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
9207
9213
  }
9208
9214
  }
9209
- let src_version = "1.5.0-beta.1";
9215
+ let src_version = "1.5.0-beta.2";
9210
9216
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack_rspack as rspack, runCLI, src_version as version };
@@ -180,7 +180,8 @@ export type RsbuildPlugin = {
180
180
  */
181
181
  remove?: string[];
182
182
  };
183
- type LooseRsbuildPlugin = Omit<RsbuildPlugin, 'setup'> & {
183
+ type LooseRsbuildPlugin = Omit<RsbuildPlugin, 'setup' | 'apply'> & {
184
+ apply?: any;
184
185
  setup: (api: any) => MaybePromise<void>;
185
186
  };
186
187
  export type RsbuildPlugins = (LooseRsbuildPlugin | Falsy | Promise<LooseRsbuildPlugin | Falsy | RsbuildPlugins> | RsbuildPlugins)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.5.0-beta.1",
3
+ "version": "1.5.0-beta.2",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -53,7 +53,7 @@
53
53
  "jiti": "^2.5.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@rslib/core": "0.11.2",
56
+ "@rslib/core": "0.12.0",
57
57
  "@types/connect": "3.4.38",
58
58
  "@types/cors": "^2.8.19",
59
59
  "@types/node": "^22.17.1",
@@ -88,7 +88,7 @@
88
88
  "style-loader": "3.3.4",
89
89
  "tinyglobby": "^0.2.14",
90
90
  "typescript": "^5.9.2",
91
- "webpack": "^5.101.0",
91
+ "webpack": "^5.101.1",
92
92
  "webpack-bundle-analyzer": "^4.10.2",
93
93
  "webpack-merge": "6.0.1",
94
94
  "ws": "^8.18.3"