@rsbuild/core 1.0.1 → 1.0.3

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
- 1668: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 5457: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(5288);
5
+ const loader = __nccwpck_require__(4542);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(9049).defaultGetLocalIdent;
8
+ __nccwpck_require__(1542).defaultGetLocalIdent;
9
9
  },
10
- 5288: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 4542: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(9961));
15
15
  var _package = _interopRequireDefault(__nccwpck_require__(6441));
16
16
  var _semver = __nccwpck_require__(938);
17
- var _options = _interopRequireDefault(__nccwpck_require__(9965));
18
- var _plugins = __nccwpck_require__(7723);
19
- var _utils = __nccwpck_require__(9049);
17
+ var _options = _interopRequireDefault(__nccwpck_require__(6509));
18
+ var _plugins = __nccwpck_require__(4871);
19
+ var _utils = __nccwpck_require__(1542);
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
- 7723: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 4871: (__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__(5583),
268
+ __nccwpck_require__(5546),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(1789),
271
+ __nccwpck_require__(1156),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(9758));
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(5299));
274
274
  function _interopRequireDefault(obj) {
275
275
  return obj && obj.__esModule ? obj : { default: obj };
276
276
  }
277
277
  },
278
- 1789: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 1156: (__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__(7718);
283
- var _utils = __nccwpck_require__(9049);
283
+ var _utils = __nccwpck_require__(1542);
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
- 5583: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 5546: (__unused_webpack_module, exports, __nccwpck_require__) => {
383
383
  "use strict";
384
384
  Object.defineProperty(exports, "__esModule", { value: true });
385
385
  exports["default"] = void 0;
386
386
  var _postcssValueParser = _interopRequireDefault(
387
387
  __nccwpck_require__(7555),
388
388
  );
389
- var _utils = __nccwpck_require__(9049);
389
+ var _utils = __nccwpck_require__(1542);
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
- 9758: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 5299: (__unused_webpack_module, exports, __nccwpck_require__) => {
695
695
  "use strict";
696
696
  Object.defineProperty(exports, "__esModule", { value: true });
697
697
  exports["default"] = void 0;
698
698
  var _postcssValueParser = _interopRequireDefault(
699
699
  __nccwpck_require__(7555),
700
700
  );
701
- var _utils = __nccwpck_require__(9049);
701
+ var _utils = __nccwpck_require__(1542);
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
- 9049: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 1542: (__unused_webpack_module, exports, __nccwpck_require__) => {
1045
1045
  "use strict";
1046
1046
  Object.defineProperty(exports, "__esModule", { value: true });
1047
1047
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -7964,7 +7964,7 @@
7964
7964
  "use strict";
7965
7965
  module.exports = require("util");
7966
7966
  },
7967
- 9965: (module) => {
7967
+ 6509: (module) => {
7968
7968
  "use strict";
7969
7969
  module.exports = JSON.parse(
7970
7970
  '{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack-contrib/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack-contrib/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack-contrib/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack-contrib/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack-contrib/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack-contrib/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack-contrib/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack-contrib/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack-contrib/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack-contrib/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack-contrib/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack-contrib/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack-contrib/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack-contrib/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack-contrib/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
@@ -7999,6 +7999,6 @@
7999
7999
  }
8000
8000
  if (typeof __nccwpck_require__ !== "undefined")
8001
8001
  __nccwpck_require__.ab = __dirname + "/";
8002
- var __webpack_exports__ = __nccwpck_require__(1668);
8002
+ var __webpack_exports__ = __nccwpck_require__(5457);
8003
8003
  module.exports = __webpack_exports__;
8004
8004
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 922: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 894: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(595);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(426);
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
- 595: (module) => {
307
+ 426: (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
- 109: (module) => {
476
+ 955: (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
- 693: (module) => {
495
+ 265: (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
- 129: (module, __unused_webpack_exports, __nccwpck_require__) => {
516
+ 411: (module, __unused_webpack_exports, __nccwpck_require__) => {
517
517
  "use strict";
518
518
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(348);
519
519
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -539,7 +539,7 @@
539
539
  }
540
540
  module.exports = { getHtmlRspackPluginHooks };
541
541
  },
542
- 162: (module) => {
542
+ 647: (module) => {
543
543
  const voidTags = [
544
544
  "area",
545
545
  "base",
@@ -607,19 +607,19 @@
607
607
  htmlTagObjectToString,
608
608
  };
609
609
  },
610
- 138: (module, __unused_webpack_exports, __nccwpck_require__) => {
610
+ 693: (module, __unused_webpack_exports, __nccwpck_require__) => {
611
611
  "use strict";
612
612
  const promisify = __nccwpck_require__(837).promisify;
613
613
  const vm = __nccwpck_require__(144);
614
614
  const fs = __nccwpck_require__(147);
615
615
  const path = __nccwpck_require__(17);
616
- const { CachedChildCompilation } = __nccwpck_require__(922);
616
+ const { CachedChildCompilation } = __nccwpck_require__(894);
617
617
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
618
- __nccwpck_require__(162);
619
- const prettyError = __nccwpck_require__(693);
620
- const chunkSorter = __nccwpck_require__(109);
618
+ __nccwpck_require__(647);
619
+ const prettyError = __nccwpck_require__(265);
620
+ const chunkSorter = __nccwpck_require__(955);
621
621
  const getHtmlRspackPluginHooks =
622
- __nccwpck_require__(129).getHtmlRspackPluginHooks;
622
+ __nccwpck_require__(411).getHtmlRspackPluginHooks;
623
623
  class HtmlRspackPlugin {
624
624
  constructor(userOptions = {}) {
625
625
  this.version = HtmlRspackPlugin.version;
@@ -1577,6 +1577,6 @@
1577
1577
  }
1578
1578
  if (typeof __nccwpck_require__ !== "undefined")
1579
1579
  __nccwpck_require__.ab = __dirname + "/";
1580
- var __webpack_exports__ = __nccwpck_require__(138);
1580
+ var __webpack_exports__ = __nccwpck_require__(693);
1581
1581
  module.exports = __webpack_exports__;
1582
1582
  })();
@@ -1,17 +1,17 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 681: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(96)["default"];
4
+ 709: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(354)["default"];
6
6
  },
7
- 96: (__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__(17));
12
12
  var _package = _interopRequireDefault(__nccwpck_require__(441));
13
- var _options = _interopRequireDefault(__nccwpck_require__(698));
14
- var _utils = __nccwpck_require__(910);
13
+ var _options = _interopRequireDefault(__nccwpck_require__(754));
14
+ var _utils = __nccwpck_require__(522);
15
15
  function _interopRequireDefault(obj) {
16
16
  return obj && obj.__esModule ? obj : { default: obj };
17
17
  }
@@ -189,7 +189,7 @@
189
189
  callback(null, result.css, map, { ast });
190
190
  }
191
191
  },
192
- 910: (module, exports, __nccwpck_require__) => {
192
+ 522: (module, exports, __nccwpck_require__) => {
193
193
  module = __nccwpck_require__.nmd(module);
194
194
  Object.defineProperty(exports, "__esModule", { value: true });
195
195
  exports.exec = exec;
@@ -694,7 +694,7 @@
694
694
  310: (module) => {
695
695
  module.exports = require("url");
696
696
  },
697
- 698: (module) => {
697
+ 754: (module) => {
698
698
  module.exports = JSON.parse(
699
699
  '{"title":"PostCSS Loader options","type":"object","properties":{"postcssOptions":{"description":"Options to pass through to `Postcss`.","link":"https://github.com/webpack-contrib/postcss-loader#postcssOptions","anyOf":[{"type":"object","additionalProperties":true,"properties":{"config":{"description":"Allows to specify PostCSS config path.","link":"https://github.com/webpack-contrib/postcss-loader#config","anyOf":[{"description":"Allows to specify the path to the configuration file","type":"string"},{"description":"Enables/Disables autoloading config","type":"boolean"}]}}},{"instanceof":"Function"}]},"execute":{"description":"Enables/Disables PostCSS parser support in \'CSS-in-JS\'.","link":"https://github.com/webpack-contrib/postcss-loader#execute","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/postcss-loader#sourcemap","type":"boolean"},"implementation":{"description":"The implementation of postcss to use, instead of the locally installed version","link":"https://github.com/webpack-contrib/postcss-loader#implementation","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
700
700
  );
@@ -739,6 +739,6 @@
739
739
  })();
740
740
  if (typeof __nccwpck_require__ !== "undefined")
741
741
  __nccwpck_require__.ab = __dirname + "/";
742
- var __webpack_exports__ = __nccwpck_require__(681);
742
+ var __webpack_exports__ = __nccwpck_require__(709);
743
743
  module.exports = __webpack_exports__;
744
744
  })();
@@ -381,6 +381,7 @@ declare namespace Config {
381
381
  preferAbsolute(value: RspackResolve['preferAbsolute']): this;
382
382
 
383
383
  plugin(name: string): Plugin<this, ResolvePlugin>;
384
+ tsConfig(value: RspackResolve['tsConfig']): this;
384
385
  }
385
386
 
386
387
  class RuleResolve<T = Config> extends Resolve<T> {
@@ -627,7 +627,7 @@
627
627
  };
628
628
  exports.toString = toString;
629
629
  },
630
- 626: (module) => {
630
+ 432: (module) => {
631
631
  module.exports = class extends Function {
632
632
  constructor() {
633
633
  super();
@@ -640,35 +640,35 @@
640
640
  }
641
641
  };
642
642
  },
643
- 446: (module, __unused_webpack_exports, __nccwpck_require__) => {
644
- const createMap = __nccwpck_require__(787);
645
- const createChainable = __nccwpck_require__(72);
643
+ 684: (module, __unused_webpack_exports, __nccwpck_require__) => {
644
+ const createMap = __nccwpck_require__(84);
645
+ const createChainable = __nccwpck_require__(537);
646
646
  module.exports = createMap(createChainable(Object));
647
647
  },
648
- 578: (module, __unused_webpack_exports, __nccwpck_require__) => {
649
- const createSet = __nccwpck_require__(178);
650
- const createChainable = __nccwpck_require__(72);
648
+ 740: (module, __unused_webpack_exports, __nccwpck_require__) => {
649
+ const createSet = __nccwpck_require__(566);
650
+ const createChainable = __nccwpck_require__(537);
651
651
  module.exports = createSet(createChainable(Object));
652
652
  },
653
- 830: (module, __unused_webpack_exports, __nccwpck_require__) => {
654
- const Callable = __nccwpck_require__(626);
655
- const createMap = __nccwpck_require__(787);
656
- const createChainable = __nccwpck_require__(72);
657
- const createValue = __nccwpck_require__(724);
653
+ 792: (module, __unused_webpack_exports, __nccwpck_require__) => {
654
+ const Callable = __nccwpck_require__(432);
655
+ const createMap = __nccwpck_require__(84);
656
+ const createChainable = __nccwpck_require__(537);
657
+ const createValue = __nccwpck_require__(908);
658
658
  module.exports = createValue(createMap(createChainable(Callable)));
659
659
  },
660
- 979: (module, __unused_webpack_exports, __nccwpck_require__) => {
661
- const ChainedMap = __nccwpck_require__(446);
662
- const ChainedValueMap = __nccwpck_require__(830);
663
- const ChainedSet = __nccwpck_require__(578);
664
- const Resolve = __nccwpck_require__(498);
665
- const ResolveLoader = __nccwpck_require__(619);
666
- const Output = __nccwpck_require__(421);
667
- const DevServer = __nccwpck_require__(279);
668
- const Plugin = __nccwpck_require__(662);
669
- const Module = __nccwpck_require__(402);
670
- const Optimization = __nccwpck_require__(406);
671
- const Performance = __nccwpck_require__(529);
660
+ 173: (module, __unused_webpack_exports, __nccwpck_require__) => {
661
+ const ChainedMap = __nccwpck_require__(684);
662
+ const ChainedValueMap = __nccwpck_require__(792);
663
+ const ChainedSet = __nccwpck_require__(740);
664
+ const Resolve = __nccwpck_require__(894);
665
+ const ResolveLoader = __nccwpck_require__(799);
666
+ const Output = __nccwpck_require__(43);
667
+ const DevServer = __nccwpck_require__(692);
668
+ const Plugin = __nccwpck_require__(360);
669
+ const Module = __nccwpck_require__(310);
670
+ const Optimization = __nccwpck_require__(812);
671
+ const Performance = __nccwpck_require__(549);
672
672
  module.exports = class extends ChainedMap {
673
673
  constructor() {
674
674
  super();
@@ -818,9 +818,9 @@
818
818
  }
819
819
  };
820
820
  },
821
- 279: (module, __unused_webpack_exports, __nccwpck_require__) => {
822
- const ChainedMap = __nccwpck_require__(446);
823
- const ChainedSet = __nccwpck_require__(578);
821
+ 692: (module, __unused_webpack_exports, __nccwpck_require__) => {
822
+ const ChainedMap = __nccwpck_require__(684);
823
+ const ChainedSet = __nccwpck_require__(740);
824
824
  module.exports = class extends ChainedMap {
825
825
  constructor(parent) {
826
826
  super(parent);
@@ -892,9 +892,9 @@
892
892
  }
893
893
  };
894
894
  },
895
- 402: (module, __unused_webpack_exports, __nccwpck_require__) => {
896
- const ChainedMap = __nccwpck_require__(446);
897
- const Rule = __nccwpck_require__(85);
895
+ 310: (module, __unused_webpack_exports, __nccwpck_require__) => {
896
+ const ChainedMap = __nccwpck_require__(684);
897
+ const Rule = __nccwpck_require__(315);
898
898
  module.exports = class extends ChainedMap {
899
899
  constructor(parent) {
900
900
  super(parent);
@@ -949,10 +949,10 @@
949
949
  }
950
950
  };
951
951
  },
952
- 406: (module, __unused_webpack_exports, __nccwpck_require__) => {
953
- const ChainedMap = __nccwpck_require__(446);
954
- const ChainedValueMap = __nccwpck_require__(830);
955
- const Plugin = __nccwpck_require__(662);
952
+ 812: (module, __unused_webpack_exports, __nccwpck_require__) => {
953
+ const ChainedMap = __nccwpck_require__(684);
954
+ const ChainedValueMap = __nccwpck_require__(792);
955
+ const Plugin = __nccwpck_require__(360);
956
956
  module.exports = class extends ChainedMap {
957
957
  constructor(parent) {
958
958
  super(parent);
@@ -1013,7 +1013,7 @@
1013
1013
  }
1014
1014
  };
1015
1015
  },
1016
- 704: (module) => {
1016
+ 201: (module) => {
1017
1017
  module.exports = (Class) =>
1018
1018
  class extends Class {
1019
1019
  before(name) {
@@ -1045,8 +1045,8 @@
1045
1045
  }
1046
1046
  };
1047
1047
  },
1048
- 421: (module, __unused_webpack_exports, __nccwpck_require__) => {
1049
- const ChainedMap = __nccwpck_require__(446);
1048
+ 43: (module, __unused_webpack_exports, __nccwpck_require__) => {
1049
+ const ChainedMap = __nccwpck_require__(684);
1050
1050
  module.exports = class extends ChainedMap {
1051
1051
  constructor(parent) {
1052
1052
  super(parent);
@@ -1100,8 +1100,8 @@
1100
1100
  }
1101
1101
  };
1102
1102
  },
1103
- 529: (module, __unused_webpack_exports, __nccwpck_require__) => {
1104
- const ChainedValueMap = __nccwpck_require__(830);
1103
+ 549: (module, __unused_webpack_exports, __nccwpck_require__) => {
1104
+ const ChainedValueMap = __nccwpck_require__(792);
1105
1105
  module.exports = class extends ChainedValueMap {
1106
1106
  constructor(parent) {
1107
1107
  super(parent);
@@ -1114,9 +1114,9 @@
1114
1114
  }
1115
1115
  };
1116
1116
  },
1117
- 662: (module, __unused_webpack_exports, __nccwpck_require__) => {
1118
- const ChainedMap = __nccwpck_require__(446);
1119
- const Orderable = __nccwpck_require__(704);
1117
+ 360: (module, __unused_webpack_exports, __nccwpck_require__) => {
1118
+ const ChainedMap = __nccwpck_require__(684);
1119
+ const Orderable = __nccwpck_require__(201);
1120
1120
  module.exports = Orderable(
1121
1121
  class extends ChainedMap {
1122
1122
  constructor(parent, name, type = "plugin") {
@@ -1170,7 +1170,7 @@
1170
1170
  }
1171
1171
  if (typeof plugin === "string") {
1172
1172
  pluginPath = plugin;
1173
- plugin = __nccwpck_require__(937)(pluginPath);
1173
+ plugin = __nccwpck_require__(900)(pluginPath);
1174
1174
  }
1175
1175
  const constructorName = plugin.__expression
1176
1176
  ? `(${plugin.__expression})`
@@ -1188,10 +1188,10 @@
1188
1188
  },
1189
1189
  );
1190
1190
  },
1191
- 498: (module, __unused_webpack_exports, __nccwpck_require__) => {
1192
- const ChainedMap = __nccwpck_require__(446);
1193
- const ChainedSet = __nccwpck_require__(578);
1194
- const Plugin = __nccwpck_require__(662);
1191
+ 894: (module, __unused_webpack_exports, __nccwpck_require__) => {
1192
+ const ChainedMap = __nccwpck_require__(684);
1193
+ const ChainedSet = __nccwpck_require__(740);
1194
+ const Plugin = __nccwpck_require__(360);
1195
1195
  const childMaps = ["alias", "fallback", "byDependency"];
1196
1196
  const childSets = [
1197
1197
  "aliasFields",
@@ -1224,6 +1224,7 @@
1224
1224
  "unsafeCache",
1225
1225
  "preferRelative",
1226
1226
  "preferAbsolute",
1227
+ "tsConfig",
1227
1228
  ]);
1228
1229
  }
1229
1230
  plugin(name) {
@@ -1269,9 +1270,9 @@
1269
1270
  }
1270
1271
  };
1271
1272
  },
1272
- 619: (module, __unused_webpack_exports, __nccwpck_require__) => {
1273
- const Resolve = __nccwpck_require__(498);
1274
- const ChainedSet = __nccwpck_require__(578);
1273
+ 799: (module, __unused_webpack_exports, __nccwpck_require__) => {
1274
+ const Resolve = __nccwpck_require__(894);
1275
+ const ChainedSet = __nccwpck_require__(740);
1275
1276
  module.exports = class extends Resolve {
1276
1277
  constructor(parent) {
1277
1278
  super(parent);
@@ -1298,12 +1299,12 @@
1298
1299
  }
1299
1300
  };
1300
1301
  },
1301
- 85: (module, __unused_webpack_exports, __nccwpck_require__) => {
1302
- const ChainedMap = __nccwpck_require__(446);
1303
- const ChainedSet = __nccwpck_require__(578);
1304
- const Orderable = __nccwpck_require__(704);
1305
- const Use = __nccwpck_require__(222);
1306
- const Resolve = __nccwpck_require__(498);
1302
+ 315: (module, __unused_webpack_exports, __nccwpck_require__) => {
1303
+ const ChainedMap = __nccwpck_require__(684);
1304
+ const ChainedSet = __nccwpck_require__(740);
1305
+ const Orderable = __nccwpck_require__(201);
1306
+ const Use = __nccwpck_require__(735);
1307
+ const Resolve = __nccwpck_require__(894);
1307
1308
  function toArray(arr) {
1308
1309
  return Array.isArray(arr) ? arr : [arr];
1309
1310
  }
@@ -1428,10 +1429,10 @@
1428
1429
  );
1429
1430
  module.exports = Rule;
1430
1431
  },
1431
- 222: (module, __unused_webpack_exports, __nccwpck_require__) => {
1432
+ 735: (module, __unused_webpack_exports, __nccwpck_require__) => {
1432
1433
  const merge = __nccwpck_require__(964);
1433
- const ChainedMap = __nccwpck_require__(446);
1434
- const Orderable = __nccwpck_require__(704);
1434
+ const ChainedMap = __nccwpck_require__(684);
1435
+ const Orderable = __nccwpck_require__(201);
1435
1436
  module.exports = Orderable(
1436
1437
  class extends ChainedMap {
1437
1438
  constructor(parent, name) {
@@ -1464,7 +1465,7 @@
1464
1465
  },
1465
1466
  );
1466
1467
  },
1467
- 72: (module) => {
1468
+ 537: (module) => {
1468
1469
  module.exports = function createChainable(superClass) {
1469
1470
  return class extends superClass {
1470
1471
  constructor(parent) {
@@ -1481,7 +1482,7 @@
1481
1482
  };
1482
1483
  };
1483
1484
  },
1484
- 787: (module, __unused_webpack_exports, __nccwpck_require__) => {
1485
+ 84: (module, __unused_webpack_exports, __nccwpck_require__) => {
1485
1486
  const merge = __nccwpck_require__(964);
1486
1487
  module.exports = function createMap(superClass) {
1487
1488
  return class extends superClass {
@@ -1605,7 +1606,7 @@
1605
1606
  };
1606
1607
  };
1607
1608
  },
1608
- 178: (module) => {
1609
+ 566: (module) => {
1609
1610
  module.exports = function createSet(superClass) {
1610
1611
  return class extends superClass {
1611
1612
  constructor(...args) {
@@ -1655,7 +1656,7 @@
1655
1656
  };
1656
1657
  };
1657
1658
  },
1658
- 724: (module) => {
1659
+ 908: (module) => {
1659
1660
  module.exports = function createValue(superClass) {
1660
1661
  return class extends superClass {
1661
1662
  constructor(...args) {
@@ -1693,7 +1694,7 @@
1693
1694
  };
1694
1695
  };
1695
1696
  },
1696
- 937: (module) => {
1697
+ 900: (module) => {
1697
1698
  function webpackEmptyContext(req) {
1698
1699
  var e = new Error("Cannot find module '" + req + "'");
1699
1700
  e.code = "MODULE_NOT_FOUND";
@@ -1701,7 +1702,7 @@
1701
1702
  }
1702
1703
  webpackEmptyContext.keys = () => [];
1703
1704
  webpackEmptyContext.resolve = webpackEmptyContext;
1704
- webpackEmptyContext.id = 937;
1705
+ webpackEmptyContext.id = 900;
1705
1706
  module.exports = webpackEmptyContext;
1706
1707
  },
1707
1708
  };
@@ -1731,6 +1732,6 @@
1731
1732
  })();
1732
1733
  if (typeof __nccwpck_require__ !== "undefined")
1733
1734
  __nccwpck_require__.ab = __dirname + "/";
1734
- var __webpack_exports__ = __nccwpck_require__(979);
1735
+ var __webpack_exports__ = __nccwpck_require__(173);
1735
1736
  module.exports = __webpack_exports__;
1736
1737
  })();
@@ -1 +1 @@
1
- {"name":"rspack-chain","author":"rspack-contrib","version":"1.0.0","license":"MPL-2.0","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"rspack-chain","author":"rspack-contrib","version":"1.0.1","license":"MPL-2.0","types":"index.d.ts","type":"commonjs"}
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 107: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 525: (__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
- 428: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 950: (__unused_webpack_module, exports, __nccwpck_require__) => {
124
124
  Object.defineProperty(exports, "__esModule", { value: true });
125
125
  exports.normalModuleLoaderHook =
126
126
  exports.getCompilerHooks =
@@ -130,7 +130,7 @@
130
130
  const fs_1 = __nccwpck_require__(147);
131
131
  const path_1 = __nccwpck_require__(17);
132
132
  const lite_tapable_1 = __nccwpck_require__(348);
133
- const helpers_1 = __nccwpck_require__(107);
133
+ const helpers_1 = __nccwpck_require__(525);
134
134
  const compilerHookMap = new WeakMap();
135
135
  const getCompilerHooks = (compiler) => {
136
136
  let hooks = compilerHookMap.get(compiler);
@@ -312,7 +312,7 @@
312
312
  exports.getCompilerHooks =
313
313
  void 0;
314
314
  const path_1 = __nccwpck_require__(17);
315
- const hooks_1 = __nccwpck_require__(428);
315
+ const hooks_1 = __nccwpck_require__(950);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
package/dist/index.cjs CHANGED
@@ -148,7 +148,7 @@ var init_constants = __esm({
148
148
  "use strict";
149
149
  import_node_path = require("path");
150
150
  ROOT_DIST_DIR = "dist";
151
- HTML_DIST_DIR = "/";
151
+ HTML_DIST_DIR = "./";
152
152
  JS_DIST_DIR = "static/js";
153
153
  CSS_DIST_DIR = "static/css";
154
154
  SVG_DIST_DIR = "static/svg";
@@ -1959,7 +1959,13 @@ function getHTMLPathByEntry(entryName, config) {
1959
1959
  } else {
1960
1960
  filename = `${entryName}/index.html`;
1961
1961
  }
1962
- return removeLeadingSlash(import_node_path8.posix.join(config.output.distPath.html, filename));
1962
+ const prefix = config.output.distPath.html;
1963
+ if (prefix.startsWith("/")) {
1964
+ import_rslog.logger.warn(
1965
+ `Absolute path is not recommended at \`output.distPath.html\`: "${prefix}", please use relative path instead.`
1966
+ );
1967
+ }
1968
+ return removeLeadingSlash(import_node_path8.posix.join(prefix, filename));
1963
1969
  }
1964
1970
  function initPluginAPI({
1965
1971
  context,
@@ -2154,6 +2160,7 @@ var init_initPlugins = __esm({
2154
2160
  init_constants();
2155
2161
  init_createContext();
2156
2162
  init_helpers();
2163
+ init_logger();
2157
2164
  init_pluginManager();
2158
2165
  mapProcessAssetsStage = (compiler, stage) => {
2159
2166
  const { Compilation } = compiler.webpack;
@@ -2297,7 +2304,7 @@ async function createContext(options, userConfig, bundlerType) {
2297
2304
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
2298
2305
  const cachePath = (0, import_node_path9.join)(rootPath, "node_modules", ".cache");
2299
2306
  return {
2300
- version: "1.0.1",
2307
+ version: "1.0.3",
2301
2308
  rootPath,
2302
2309
  distPath: "",
2303
2310
  cachePath,
@@ -2926,7 +2933,13 @@ async function initRsbuildConfig({
2926
2933
  context.specifiedEnvironments
2927
2934
  );
2928
2935
  const {
2929
- dev: { assetPrefix, lazyCompilation, ...rsbuildSharedDev },
2936
+ dev: {
2937
+ hmr,
2938
+ assetPrefix,
2939
+ progressBar,
2940
+ lazyCompilation,
2941
+ ...rsbuildSharedDev
2942
+ },
2930
2943
  server
2931
2944
  } = normalizeBaseConfig;
2932
2945
  for (const [name, config] of Object.entries(mergedEnvironments)) {
@@ -3015,7 +3028,6 @@ var init_initConfigs = __esm({
3015
3028
  return defaultEntry;
3016
3029
  };
3017
3030
  const { environments, dev, server, provider, ...rsbuildSharedConfig } = normalizedConfig;
3018
- const { assetPrefix, lazyCompilation } = dev;
3019
3031
  const isEnvironmentEnabled = (name) => !specifiedEnvironments || specifiedEnvironments.includes(name);
3020
3032
  const applyEnvironmentDefaultConfig = (config) => {
3021
3033
  if (!config.source.entry || Object.keys(config.source.entry).length === 0) {
@@ -3034,10 +3046,12 @@ var init_initConfigs = __esm({
3034
3046
  ...mergeRsbuildConfig(
3035
3047
  {
3036
3048
  ...rsbuildSharedConfig,
3037
- dev: {
3038
- assetPrefix,
3039
- lazyCompilation
3040
- }
3049
+ dev: pick(dev, [
3050
+ "hmr",
3051
+ "assetPrefix",
3052
+ "progressBar",
3053
+ "lazyCompilation"
3054
+ ])
3041
3055
  },
3042
3056
  config
3043
3057
  )
@@ -3061,10 +3075,7 @@ var init_initConfigs = __esm({
3061
3075
  return {
3062
3076
  [defaultEnvironmentName]: applyEnvironmentDefaultConfig({
3063
3077
  ...rsbuildSharedConfig,
3064
- dev: {
3065
- assetPrefix,
3066
- lazyCompilation
3067
- }
3078
+ dev: pick(dev, ["hmr", "assetPrefix", "progressBar", "lazyCompilation"])
3068
3079
  })
3069
3080
  };
3070
3081
  };
@@ -5133,7 +5144,9 @@ var init_build = __esm({
5133
5144
  });
5134
5145
  return {
5135
5146
  close: () => new Promise((resolve2) => {
5136
- watching.close(resolve2);
5147
+ watching.close(() => {
5148
+ resolve2();
5149
+ });
5137
5150
  })
5138
5151
  };
5139
5152
  }
@@ -5259,7 +5272,7 @@ var init_basic2 = __esm({
5259
5272
  name: "rsbuild:basic",
5260
5273
  setup(api) {
5261
5274
  api.modifyBundlerChain(
5262
- (chain, { env, isProd, target, bundler, environment, CHAIN_ID: CHAIN_ID2 }) => {
5275
+ (chain, { env, isDev, target, bundler, environment, CHAIN_ID: CHAIN_ID2 }) => {
5263
5276
  const { config } = environment;
5264
5277
  chain.name(environment.name);
5265
5278
  chain.devtool(getJsSourceMap(config));
@@ -5277,7 +5290,7 @@ var init_basic2 = __esm({
5277
5290
  exportsPresence: "error"
5278
5291
  }
5279
5292
  });
5280
- const usingHMR = !isProd && config.dev.hmr && target === "web";
5293
+ const usingHMR = isDev && config.dev.hmr && target === "web";
5281
5294
  if (usingHMR) {
5282
5295
  chain.plugin(CHAIN_ID2.PLUGIN.HMR).use(bundler.HotModuleReplacementPlugin);
5283
5296
  }
@@ -6079,7 +6092,7 @@ var init_resolve = __esm({
6079
6092
  api.modifyBundlerChain({
6080
6093
  order: "pre",
6081
6094
  handler: (chain, { environment, CHAIN_ID: CHAIN_ID2 }) => {
6082
- const { config } = environment;
6095
+ const { config, tsconfigPath } = environment;
6083
6096
  applyExtensions({ chain });
6084
6097
  applyAlias({
6085
6098
  chain,
@@ -6087,19 +6100,12 @@ var init_resolve = __esm({
6087
6100
  rootPath: api.context.rootPath
6088
6101
  });
6089
6102
  applyFullySpecified({ chain, config, CHAIN_ID: CHAIN_ID2 });
6090
- }
6091
- });
6092
- api.modifyRspackConfig(async (rspackConfig, { environment }) => {
6093
- const { tsconfigPath, config } = environment;
6094
- if (tsconfigPath && config.source.aliasStrategy === "prefer-tsconfig") {
6095
- rspackConfig.resolve ||= {};
6096
- if (typeof rspackConfig.resolve.tsConfig === "string") {
6097
- return;
6103
+ if (tsconfigPath && // Only Rspack has the tsConfig option
6104
+ api.context.bundlerType === "rspack" && config.source.aliasStrategy === "prefer-tsconfig") {
6105
+ chain.resolve.tsConfig({
6106
+ configFile: tsconfigPath
6107
+ });
6098
6108
  }
6099
- rspackConfig.resolve.tsConfig = {
6100
- configFile: tsconfigPath,
6101
- ...rspackConfig.resolve.tsConfig
6102
- };
6103
6109
  }
6104
6110
  });
6105
6111
  }
@@ -9669,7 +9675,7 @@ var init_init = __esm({
9669
9675
 
9670
9676
  // src/cli/commands.ts
9671
9677
  function runCli() {
9672
- import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.1");
9678
+ import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.3");
9673
9679
  const devCommand = import_commander.program.command("dev");
9674
9680
  const buildCommand = import_commander.program.command("build");
9675
9681
  const previewCommand = import_commander.program.command("preview");
@@ -9792,7 +9798,7 @@ function prepareCli() {
9792
9798
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9793
9799
  console.log();
9794
9800
  }
9795
- import_rslog.logger.greet(` ${`Rsbuild v${"1.0.1"}`}
9801
+ import_rslog.logger.greet(` ${`Rsbuild v${"1.0.3"}`}
9796
9802
  `);
9797
9803
  }
9798
9804
  var init_prepare = __esm({
@@ -9876,7 +9882,7 @@ init_logger();
9876
9882
  init_mergeConfig();
9877
9883
  init_helpers();
9878
9884
  init_constants();
9879
- var version = "1.0.1";
9885
+ var version = "1.0.3";
9880
9886
  // Annotate the CommonJS export names for ESM import in node:
9881
9887
  0 && (module.exports = {
9882
9888
  PLUGIN_CSS_NAME,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var init_constants = __esm({
172
172
  "use strict";
173
173
  init_esm();
174
174
  ROOT_DIST_DIR = "dist";
175
- HTML_DIST_DIR = "/";
175
+ HTML_DIST_DIR = "./";
176
176
  JS_DIST_DIR = "static/js";
177
177
  CSS_DIST_DIR = "static/css";
178
178
  SVG_DIST_DIR = "static/svg";
@@ -1995,7 +1995,13 @@ function getHTMLPathByEntry(entryName, config) {
1995
1995
  } else {
1996
1996
  filename = `${entryName}/index.html`;
1997
1997
  }
1998
- return removeLeadingSlash(posix2.join(config.output.distPath.html, filename));
1998
+ const prefix = config.output.distPath.html;
1999
+ if (prefix.startsWith("/")) {
2000
+ logger.warn(
2001
+ `Absolute path is not recommended at \`output.distPath.html\`: "${prefix}", please use relative path instead.`
2002
+ );
2003
+ }
2004
+ return removeLeadingSlash(posix2.join(prefix, filename));
1999
2005
  }
2000
2006
  function initPluginAPI({
2001
2007
  context,
@@ -2190,6 +2196,7 @@ var init_initPlugins = __esm({
2190
2196
  init_constants();
2191
2197
  init_createContext();
2192
2198
  init_helpers();
2199
+ init_logger();
2193
2200
  init_pluginManager();
2194
2201
  mapProcessAssetsStage = (compiler, stage) => {
2195
2202
  const { Compilation } = compiler.webpack;
@@ -2335,7 +2342,7 @@ async function createContext(options, userConfig, bundlerType) {
2335
2342
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
2336
2343
  const cachePath = join6(rootPath, "node_modules", ".cache");
2337
2344
  return {
2338
- version: "1.0.1",
2345
+ version: "1.0.3",
2339
2346
  rootPath,
2340
2347
  distPath: "",
2341
2348
  cachePath,
@@ -2968,7 +2975,13 @@ async function initRsbuildConfig({
2968
2975
  context.specifiedEnvironments
2969
2976
  );
2970
2977
  const {
2971
- dev: { assetPrefix, lazyCompilation, ...rsbuildSharedDev },
2978
+ dev: {
2979
+ hmr,
2980
+ assetPrefix,
2981
+ progressBar,
2982
+ lazyCompilation,
2983
+ ...rsbuildSharedDev
2984
+ },
2972
2985
  server
2973
2986
  } = normalizeBaseConfig;
2974
2987
  for (const [name, config] of Object.entries(mergedEnvironments)) {
@@ -3057,7 +3070,6 @@ var init_initConfigs = __esm({
3057
3070
  return defaultEntry;
3058
3071
  };
3059
3072
  const { environments, dev, server, provider, ...rsbuildSharedConfig } = normalizedConfig;
3060
- const { assetPrefix, lazyCompilation } = dev;
3061
3073
  const isEnvironmentEnabled = (name) => !specifiedEnvironments || specifiedEnvironments.includes(name);
3062
3074
  const applyEnvironmentDefaultConfig = (config) => {
3063
3075
  if (!config.source.entry || Object.keys(config.source.entry).length === 0) {
@@ -3076,10 +3088,12 @@ var init_initConfigs = __esm({
3076
3088
  ...mergeRsbuildConfig(
3077
3089
  {
3078
3090
  ...rsbuildSharedConfig,
3079
- dev: {
3080
- assetPrefix,
3081
- lazyCompilation
3082
- }
3091
+ dev: pick(dev, [
3092
+ "hmr",
3093
+ "assetPrefix",
3094
+ "progressBar",
3095
+ "lazyCompilation"
3096
+ ])
3083
3097
  },
3084
3098
  config
3085
3099
  )
@@ -3103,10 +3117,7 @@ var init_initConfigs = __esm({
3103
3117
  return {
3104
3118
  [defaultEnvironmentName]: applyEnvironmentDefaultConfig({
3105
3119
  ...rsbuildSharedConfig,
3106
- dev: {
3107
- assetPrefix,
3108
- lazyCompilation
3109
- }
3120
+ dev: pick(dev, ["hmr", "assetPrefix", "progressBar", "lazyCompilation"])
3110
3121
  })
3111
3122
  };
3112
3123
  };
@@ -5194,7 +5205,9 @@ var init_build = __esm({
5194
5205
  });
5195
5206
  return {
5196
5207
  close: () => new Promise((resolve2) => {
5197
- watching.close(resolve2);
5208
+ watching.close(() => {
5209
+ resolve2();
5210
+ });
5198
5211
  })
5199
5212
  };
5200
5213
  }
@@ -5322,7 +5335,7 @@ var init_basic2 = __esm({
5322
5335
  name: "rsbuild:basic",
5323
5336
  setup(api) {
5324
5337
  api.modifyBundlerChain(
5325
- (chain, { env, isProd, target, bundler, environment, CHAIN_ID: CHAIN_ID2 }) => {
5338
+ (chain, { env, isDev, target, bundler, environment, CHAIN_ID: CHAIN_ID2 }) => {
5326
5339
  const { config } = environment;
5327
5340
  chain.name(environment.name);
5328
5341
  chain.devtool(getJsSourceMap(config));
@@ -5340,7 +5353,7 @@ var init_basic2 = __esm({
5340
5353
  exportsPresence: "error"
5341
5354
  }
5342
5355
  });
5343
- const usingHMR = !isProd && config.dev.hmr && target === "web";
5356
+ const usingHMR = isDev && config.dev.hmr && target === "web";
5344
5357
  if (usingHMR) {
5345
5358
  chain.plugin(CHAIN_ID2.PLUGIN.HMR).use(bundler.HotModuleReplacementPlugin);
5346
5359
  }
@@ -6150,7 +6163,7 @@ var init_resolve = __esm({
6150
6163
  api.modifyBundlerChain({
6151
6164
  order: "pre",
6152
6165
  handler: (chain, { environment, CHAIN_ID: CHAIN_ID2 }) => {
6153
- const { config } = environment;
6166
+ const { config, tsconfigPath } = environment;
6154
6167
  applyExtensions({ chain });
6155
6168
  applyAlias({
6156
6169
  chain,
@@ -6158,19 +6171,12 @@ var init_resolve = __esm({
6158
6171
  rootPath: api.context.rootPath
6159
6172
  });
6160
6173
  applyFullySpecified({ chain, config, CHAIN_ID: CHAIN_ID2 });
6161
- }
6162
- });
6163
- api.modifyRspackConfig(async (rspackConfig, { environment }) => {
6164
- const { tsconfigPath, config } = environment;
6165
- if (tsconfigPath && config.source.aliasStrategy === "prefer-tsconfig") {
6166
- rspackConfig.resolve ||= {};
6167
- if (typeof rspackConfig.resolve.tsConfig === "string") {
6168
- return;
6174
+ if (tsconfigPath && // Only Rspack has the tsConfig option
6175
+ api.context.bundlerType === "rspack" && config.source.aliasStrategy === "prefer-tsconfig") {
6176
+ chain.resolve.tsConfig({
6177
+ configFile: tsconfigPath
6178
+ });
6169
6179
  }
6170
- rspackConfig.resolve.tsConfig = {
6171
- configFile: tsconfigPath,
6172
- ...rspackConfig.resolve.tsConfig
6173
- };
6174
6180
  }
6175
6181
  });
6176
6182
  }
@@ -9778,7 +9784,7 @@ import { existsSync } from "fs";
9778
9784
  import { program } from "../compiled/commander/index.js";
9779
9785
  import color16 from "../compiled/picocolors/index.js";
9780
9786
  function runCli() {
9781
- program.name("rsbuild").usage("<command> [options]").version("1.0.1");
9787
+ program.name("rsbuild").usage("<command> [options]").version("1.0.3");
9782
9788
  const devCommand = program.command("dev");
9783
9789
  const buildCommand = program.command("build");
9784
9790
  const previewCommand = program.command("preview");
@@ -9899,7 +9905,7 @@ function prepareCli() {
9899
9905
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
9900
9906
  console.log();
9901
9907
  }
9902
- logger.greet(` ${`Rsbuild v${"1.0.1"}`}
9908
+ logger.greet(` ${`Rsbuild v${"1.0.3"}`}
9903
9909
  `);
9904
9910
  }
9905
9911
  var init_prepare = __esm({
@@ -9970,7 +9976,7 @@ init_mergeConfig();
9970
9976
  init_helpers();
9971
9977
  init_constants();
9972
9978
  import { rspack as rspack10 } from "@rspack/core";
9973
- var version = "1.0.1";
9979
+ var version = "1.0.3";
9974
9980
  export {
9975
9981
  PLUGIN_CSS_NAME,
9976
9982
  PLUGIN_SWC_NAME,
@@ -1,5 +1,5 @@
1
1
  export declare const ROOT_DIST_DIR = "dist";
2
- export declare const HTML_DIST_DIR = "/";
2
+ export declare const HTML_DIST_DIR = "./";
3
3
  export declare const JS_DIST_DIR = "static/js";
4
4
  export declare const CSS_DIST_DIR = "static/css";
5
5
  export declare const SVG_DIST_DIR = "static/svg";
@@ -994,7 +994,7 @@ export interface EnvironmentConfig {
994
994
  /**
995
995
  * Options for local development.
996
996
  */
997
- dev?: Pick<DevConfig, 'assetPrefix' | 'lazyCompilation' | 'progressBar'>;
997
+ dev?: Pick<DevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation'>;
998
998
  /**
999
999
  * Options for HTML generation.
1000
1000
  */
@@ -1068,7 +1068,7 @@ export interface RsbuildConfig extends EnvironmentConfig {
1068
1068
  export type MergedEnvironmentConfig = {
1069
1069
  mode: RsbuildMode;
1070
1070
  root: string;
1071
- dev: Pick<NormalizedDevConfig, 'assetPrefix' | 'lazyCompilation' | 'progressBar'>;
1071
+ dev: Pick<NormalizedDevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation'>;
1072
1072
  html: NormalizedHtmlConfig;
1073
1073
  tools: NormalizedToolsConfig;
1074
1074
  source: NormalizedSourceConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,9 +46,9 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "~1.0.3",
49
+ "@rspack/core": "~1.0.5",
50
50
  "@rspack/lite-tapable": "~1.0.0",
51
- "@swc/helpers": "^0.5.12",
51
+ "@swc/helpers": "^0.5.13",
52
52
  "caniuse-lite": "^1.0.30001659",
53
53
  "core-js": "~3.38.1"
54
54
  },
@@ -85,7 +85,7 @@
85
85
  "reduce-configs": "^1.0.0",
86
86
  "rsbuild-dev-middleware": "0.1.1",
87
87
  "rslog": "^1.2.3",
88
- "rspack-chain": "^1.0.0",
88
+ "rspack-chain": "^1.0.1",
89
89
  "rspack-manifest-plugin": "5.0.1",
90
90
  "sirv": "^2.0.4",
91
91
  "style-loader": "3.3.4",