@rsbuild/core 1.0.12 → 1.0.14

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
- 2139: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 3137: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(4081);
5
+ const loader = __nccwpck_require__(4965);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(7823).defaultGetLocalIdent;
8
+ __nccwpck_require__(3579).defaultGetLocalIdent;
9
9
  },
10
- 4081: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 4965: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(9961));
15
15
  var _package = _interopRequireDefault(__nccwpck_require__(3360));
16
16
  var _semver = { satisfies: () => true };
17
- var _options = _interopRequireDefault(__nccwpck_require__(9362));
18
- var _plugins = __nccwpck_require__(8370);
19
- var _utils = __nccwpck_require__(7823);
17
+ var _options = _interopRequireDefault(__nccwpck_require__(641));
18
+ var _plugins = __nccwpck_require__(1442);
19
+ var _utils = __nccwpck_require__(3579);
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
- 8370: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 1442: (__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__(9772),
268
+ __nccwpck_require__(7400),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(6620),
271
+ __nccwpck_require__(7785),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7716));
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7710));
274
274
  function _interopRequireDefault(obj) {
275
275
  return obj && obj.__esModule ? obj : { default: obj };
276
276
  }
277
277
  },
278
- 6620: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 7785: (__unused_webpack_module, exports, __nccwpck_require__) => {
279
279
  "use strict";
280
280
  Object.defineProperty(exports, "__esModule", { value: true });
281
281
  exports["default"] = void 0;
282
282
  var _icssUtils = __nccwpck_require__(8406);
283
- var _utils = __nccwpck_require__(7823);
283
+ var _utils = __nccwpck_require__(3579);
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
- 9772: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 7400: (__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__(7823);
389
+ var _utils = __nccwpck_require__(3579);
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
- 7716: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 7710: (__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__(7823);
701
+ var _utils = __nccwpck_require__(3579);
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
- 7823: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 3579: (__unused_webpack_module, exports, __nccwpck_require__) => {
1045
1045
  "use strict";
1046
1046
  Object.defineProperty(exports, "__esModule", { value: true });
1047
1047
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -7960,7 +7960,7 @@
7960
7960
  "use strict";
7961
7961
  module.exports = require("util");
7962
7962
  },
7963
- 9362: (module) => {
7963
+ 641: (module) => {
7964
7964
  "use strict";
7965
7965
  module.exports = JSON.parse(
7966
7966
  '{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack-contrib/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack-contrib/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack-contrib/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack-contrib/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack-contrib/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack-contrib/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack-contrib/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack-contrib/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack-contrib/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack-contrib/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack-contrib/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack-contrib/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack-contrib/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack-contrib/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack-contrib/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
@@ -7995,6 +7995,6 @@
7995
7995
  }
7996
7996
  if (typeof __nccwpck_require__ !== "undefined")
7997
7997
  __nccwpck_require__.ab = __dirname + "/";
7998
- var __webpack_exports__ = __nccwpck_require__(2139);
7998
+ var __webpack_exports__ = __nccwpck_require__(3137);
7999
7999
  module.exports = __webpack_exports__;
8000
8000
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 616: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 440: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(777);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(303);
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
- 777: (module) => {
307
+ 303: (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
- 269: (module) => {
476
+ 368: (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
- 273: (module) => {
495
+ 419: (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
- 718: (module, __unused_webpack_exports, __nccwpck_require__) => {
516
+ 556: (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
- 855: (module) => {
542
+ 972: (module) => {
543
543
  const voidTags = [
544
544
  "area",
545
545
  "base",
@@ -607,19 +607,19 @@
607
607
  htmlTagObjectToString,
608
608
  };
609
609
  },
610
- 997: (module, __unused_webpack_exports, __nccwpck_require__) => {
610
+ 160: (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__(616);
616
+ const { CachedChildCompilation } = __nccwpck_require__(440);
617
617
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
618
- __nccwpck_require__(855);
619
- const prettyError = __nccwpck_require__(273);
620
- const chunkSorter = __nccwpck_require__(269);
618
+ __nccwpck_require__(972);
619
+ const prettyError = __nccwpck_require__(419);
620
+ const chunkSorter = __nccwpck_require__(368);
621
621
  const getHtmlRspackPluginHooks =
622
- __nccwpck_require__(718).getHtmlRspackPluginHooks;
622
+ __nccwpck_require__(556).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__(997);
1580
+ var __webpack_exports__ = __nccwpck_require__(160);
1581
1581
  module.exports = __webpack_exports__;
1582
1582
  })();
@@ -1,17 +1,17 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 50: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(344)["default"];
4
+ 429: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(171)["default"];
6
6
  },
7
- 344: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 171: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = loader;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(17));
12
12
  var _package = _interopRequireDefault(__nccwpck_require__(360));
13
- var _options = _interopRequireDefault(__nccwpck_require__(732));
14
- var _utils = __nccwpck_require__(815);
13
+ var _options = _interopRequireDefault(__nccwpck_require__(244));
14
+ var _utils = __nccwpck_require__(990);
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
- 815: (module, exports, __nccwpck_require__) => {
192
+ 990: (module, exports, __nccwpck_require__) => {
193
193
  module = __nccwpck_require__.nmd(module);
194
194
  Object.defineProperty(exports, "__esModule", { value: true });
195
195
  exports.exec = exec;
@@ -691,7 +691,7 @@
691
691
  310: (module) => {
692
692
  module.exports = require("url");
693
693
  },
694
- 732: (module) => {
694
+ 244: (module) => {
695
695
  module.exports = JSON.parse(
696
696
  '{"title":"PostCSS Loader options","type":"object","properties":{"postcssOptions":{"description":"Options to pass through to `Postcss`.","link":"https://github.com/webpack-contrib/postcss-loader#postcssOptions","anyOf":[{"type":"object","additionalProperties":true,"properties":{"config":{"description":"Allows to specify PostCSS config path.","link":"https://github.com/webpack-contrib/postcss-loader#config","anyOf":[{"description":"Allows to specify the path to the configuration file","type":"string"},{"description":"Enables/Disables autoloading config","type":"boolean"}]}}},{"instanceof":"Function"}]},"execute":{"description":"Enables/Disables PostCSS parser support in \'CSS-in-JS\'.","link":"https://github.com/webpack-contrib/postcss-loader#execute","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/postcss-loader#sourcemap","type":"boolean"},"implementation":{"description":"The implementation of postcss to use, instead of the locally installed version","link":"https://github.com/webpack-contrib/postcss-loader#implementation","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
697
697
  );
@@ -736,6 +736,6 @@
736
736
  })();
737
737
  if (typeof __nccwpck_require__ !== "undefined")
738
738
  __nccwpck_require__.ab = __dirname + "/";
739
- var __webpack_exports__ = __nccwpck_require__(50);
739
+ var __webpack_exports__ = __nccwpck_require__(429);
740
740
  module.exports = __webpack_exports__;
741
741
  })();
@@ -1,6 +1,13 @@
1
- import { Configuration, Compiler, ResolveOptions, RuleSetRule } from '@rspack/core';
1
+ import {
2
+ Configuration,
3
+ Compiler,
4
+ RuleSetRule,
5
+ ResolveOptions,
6
+ } from '@rspack/core';
2
7
  import * as https from 'https';
3
8
 
9
+ export = Config;
10
+
4
11
  // The compiler type of Rspack / webpack are mismatch,
5
12
  // so we use a loose type here to allow using webpack plugins.
6
13
  interface PluginInstance {
@@ -599,5 +606,3 @@ declare namespace Config {
599
606
  after(name: string): this;
600
607
  }
601
608
  }
602
-
603
- export { Config as default };
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 919: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 213: (__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
- 194: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 673: (__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__(919);
133
+ const helpers_1 = __nccwpck_require__(213);
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__(194);
315
+ const hooks_1 = __nccwpck_require__(673);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
@@ -24,7 +24,7 @@
24
24
  }
25
25
  exports.parse = parse;
26
26
  },
27
- 786: (__unused_webpack_module, exports) => {
27
+ 486: (__unused_webpack_module, exports) => {
28
28
  const mimes = {
29
29
  "3g2": "video/3gpp2",
30
30
  "3gp": "video/3gpp",
@@ -469,12 +469,12 @@
469
469
  exports.mimes = mimes;
470
470
  exports.lookup = lookup;
471
471
  },
472
- 486: (module, __unused_webpack_exports, __nccwpck_require__) => {
473
- const fs = __nccwpck_require__(147);
474
- const { join, normalize, resolve } = __nccwpck_require__(17);
472
+ 761: (module, __unused_webpack_exports, __nccwpck_require__) => {
473
+ const fs = __nccwpck_require__(561);
474
+ const { join, normalize, resolve } = __nccwpck_require__(411);
475
475
  const { totalist } = __nccwpck_require__(190);
476
476
  const { parse } = __nccwpck_require__(665);
477
- const { lookup } = __nccwpck_require__(786);
477
+ const { lookup } = __nccwpck_require__(486);
478
478
  const noop = () => {};
479
479
  function isMatch(uri, arr) {
480
480
  for (let i = 0; i < arr.length; i++) {
@@ -665,6 +665,14 @@
665
665
  "use strict";
666
666
  module.exports = require("fs");
667
667
  },
668
+ 561: (module) => {
669
+ "use strict";
670
+ module.exports = require("node:fs");
671
+ },
672
+ 411: (module) => {
673
+ "use strict";
674
+ module.exports = require("node:path");
675
+ },
668
676
  17: (module) => {
669
677
  "use strict";
670
678
  module.exports = require("path");
@@ -696,6 +704,6 @@
696
704
  }
697
705
  if (typeof __nccwpck_require__ !== "undefined")
698
706
  __nccwpck_require__.ab = __dirname + "/";
699
- var __webpack_exports__ = __nccwpck_require__(486);
707
+ var __webpack_exports__ = __nccwpck_require__(761);
700
708
  module.exports = __webpack_exports__;
701
709
  })();
@@ -1 +1 @@
1
- {"name":"sirv","author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"version":"2.0.4","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"sirv","author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"version":"3.0.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/index.cjs CHANGED
@@ -3138,7 +3138,7 @@ var init_logger = __esm({
3138
3138
  });
3139
3139
 
3140
3140
  // src/constants.ts
3141
- var import_node_path, ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
3141
+ var import_node_path, ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, ASSETS_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
3142
3142
  var init_constants = __esm({
3143
3143
  "src/constants.ts"() {
3144
3144
  "use strict";
@@ -3152,6 +3152,7 @@ var init_constants = __esm({
3152
3152
  WASM_DIST_DIR = "static/wasm";
3153
3153
  IMAGE_DIST_DIR = "static/image";
3154
3154
  MEDIA_DIST_DIR = "static/media";
3155
+ ASSETS_DIST_DIR = "static/assets";
3155
3156
  LOADER_PATH = (0, import_node_path.join)(__dirname);
3156
3157
  STATIC_PATH = (0, import_node_path.join)(__dirname, "../static");
3157
3158
  COMPILED_PATH = (0, import_node_path.join)(__dirname, "../compiled");
@@ -3689,6 +3690,8 @@ function getFilename(config, type, isProd, isServer) {
3689
3690
  return filename.image ?? `[name]${hash}[ext]`;
3690
3691
  case "media":
3691
3692
  return filename.media ?? `[name]${hash}[ext]`;
3693
+ case "assets":
3694
+ return filename.assets ?? `[name]${hash}[ext]`;
3692
3695
  default:
3693
3696
  throw new Error(`unknown key ${type} in "output.filename"`);
3694
3697
  }
@@ -3830,9 +3833,8 @@ var init_helpers = __esm({
3830
3833
  return DEFAULT_ASSET_PREFIX;
3831
3834
  };
3832
3835
  urlJoin = (base, path21) => {
3833
- const fullUrl = new URL(base);
3834
- fullUrl.pathname = import_node_path4.posix.join(fullUrl.pathname, path21);
3835
- return fullUrl.toString();
3836
+ const [urlProtocol, baseUrl] = base.split("://");
3837
+ return `${urlProtocol}://${import_node_path4.posix.join(baseUrl, path21)}`;
3836
3838
  };
3837
3839
  canParse = (url2) => {
3838
3840
  try {
@@ -4187,7 +4189,7 @@ function stringifyConfig(config, verbose) {
4187
4189
  const stringify = import_rspack_chain.default.toString;
4188
4190
  return stringify(config, { verbose });
4189
4191
  }
4190
- var import_node_fs2, import_node_path6, import_picocolors5, import_rspack_chain, getDefaultDevConfig, getDefaultServerConfig, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
4192
+ var import_node_fs2, import_node_path6, import_picocolors5, import_rspack_chain, getDefaultDevConfig, getDefaultServerConfig, swcHelpersPath, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
4191
4193
  var init_config = __esm({
4192
4194
  "src/config.ts"() {
4193
4195
  "use strict";
@@ -4225,15 +4227,22 @@ var init_config = __esm({
4225
4227
  printUrls: true,
4226
4228
  strictPort: false
4227
4229
  });
4228
- getDefaultSourceConfig = () => ({
4229
- alias: {},
4230
- define: {},
4231
- aliasStrategy: "prefer-tsconfig",
4232
- preEntry: [],
4233
- decorators: {
4234
- version: "2022-03"
4230
+ getDefaultSourceConfig = () => {
4231
+ if (!swcHelpersPath) {
4232
+ swcHelpersPath = (0, import_node_path6.dirname)(require.resolve("@swc/helpers/package.json"));
4235
4233
  }
4236
- });
4234
+ return {
4235
+ alias: {
4236
+ "@swc/helpers": swcHelpersPath
4237
+ },
4238
+ define: {},
4239
+ aliasStrategy: "prefer-tsconfig",
4240
+ preEntry: [],
4241
+ decorators: {
4242
+ version: "2022-03"
4243
+ }
4244
+ };
4245
+ };
4237
4246
  getDefaultHtmlConfig = () => ({
4238
4247
  meta: {
4239
4248
  charset: { charset: "UTF-8" },
@@ -4281,7 +4290,8 @@ var init_config = __esm({
4281
4290
  html: HTML_DIST_DIR,
4282
4291
  wasm: WASM_DIST_DIR,
4283
4292
  image: IMAGE_DIST_DIR,
4284
- media: MEDIA_DIST_DIR
4293
+ media: MEDIA_DIST_DIR,
4294
+ assets: ASSETS_DIST_DIR
4285
4295
  },
4286
4296
  // Temporary placeholder, default: `${server.base}`
4287
4297
  assetPrefix: DEFAULT_ASSET_PREFIX,
@@ -6005,7 +6015,7 @@ async function createContext(options, userConfig, bundlerType) {
6005
6015
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
6006
6016
  const cachePath = (0, import_node_path10.join)(rootPath, "node_modules", ".cache");
6007
6017
  return {
6008
- version: "1.0.12",
6018
+ version: "1.0.14",
6009
6019
  rootPath,
6010
6020
  distPath: "",
6011
6021
  cachePath,
@@ -9612,7 +9622,7 @@ async function applyCSSRule({
9612
9622
  rule.merge({ sideEffects: true });
9613
9623
  rule.resolve.preferRelative(true);
9614
9624
  }
9615
- var import_node_path21, import_deepmerge2, isUseCssExtract, getCSSModulesLocalIdentName, normalizeCssLoaderOptions, userPostcssrcCache, clonePostCSSConfig, getPostcssLoaderOptions, getCSSLoaderOptions, pluginCss;
9625
+ var import_node_path21, import_deepmerge2, isUseCssExtract, getCSSModulesLocalIdentName, normalizeCssLoaderOptions, userPostcssrcCache, clonePostCSSConfig, isPostcssPluginCreator, getPostcssLoaderOptions, getCSSLoaderOptions, pluginCss;
9616
9626
  var init_css = __esm({
9617
9627
  "src/plugins/css.ts"() {
9618
9628
  "use strict";
@@ -9653,6 +9663,7 @@ var init_css = __esm({
9653
9663
  ...config,
9654
9664
  plugins: config.plugins ? [...config.plugins] : void 0
9655
9665
  });
9666
+ isPostcssPluginCreator = (plugin) => typeof plugin === "function" && plugin.postcss === true;
9656
9667
  getPostcssLoaderOptions = async ({
9657
9668
  config,
9658
9669
  root
@@ -9674,17 +9685,21 @@ var init_css = __esm({
9674
9685
  postcssOptions: userPostcssConfig,
9675
9686
  sourceMap: config.output.sourceMap.css
9676
9687
  };
9677
- const mergedConfig = reduceConfigsWithContext({
9688
+ const merged = reduceConfigsWithContext({
9678
9689
  initial: defaultPostcssConfig,
9679
9690
  config: config.tools.postcss,
9680
9691
  ctx: utils
9681
9692
  });
9693
+ merged.postcssOptions ||= {};
9694
+ merged.postcssOptions.plugins ||= [];
9682
9695
  if (extraPlugins.length) {
9683
- mergedConfig?.postcssOptions?.plugins.push(...extraPlugins);
9696
+ merged.postcssOptions.plugins.push(...extraPlugins);
9684
9697
  }
9685
- mergedConfig.postcssOptions ||= {};
9686
- mergedConfig.postcssOptions.config = false;
9687
- return mergedConfig;
9698
+ merged.postcssOptions.plugins = merged.postcssOptions.plugins.map(
9699
+ (plugin) => isPostcssPluginCreator(plugin) ? plugin() : plugin
9700
+ );
9701
+ merged.postcssOptions.config = false;
9702
+ return merged;
9688
9703
  };
9689
9704
  getCSSLoaderOptions = ({
9690
9705
  config,
@@ -10275,10 +10290,13 @@ var init_asset = __esm({
10275
10290
  setup(api) {
10276
10291
  api.modifyBundlerChain((chain, { isProd, environment }) => {
10277
10292
  const { config } = environment;
10278
- const createAssetRule = (assetType, exts, emit) => {
10279
- const regExp = getRegExpForExts(exts);
10293
+ const getMergedFilename = (assetType) => {
10280
10294
  const distDir = config.output.distPath[assetType];
10281
10295
  const filename = getFilename(config, assetType, isProd);
10296
+ return import_node_path25.default.posix.join(distDir, filename);
10297
+ };
10298
+ const createAssetRule = (assetType, exts, emit) => {
10299
+ const regExp = getRegExpForExts(exts);
10282
10300
  const { dataUriLimit } = config.output;
10283
10301
  const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
10284
10302
  const rule = chain.module.rule(assetType).test(regExp);
@@ -10286,7 +10304,7 @@ var init_asset = __esm({
10286
10304
  emit,
10287
10305
  rule,
10288
10306
  maxSize,
10289
- filename: import_node_path25.default.posix.join(distDir, filename),
10307
+ filename: getMergedFilename(assetType),
10290
10308
  assetType
10291
10309
  });
10292
10310
  };
@@ -10299,6 +10317,11 @@ var init_asset = __esm({
10299
10317
  emitAssets
10300
10318
  );
10301
10319
  createAssetRule("font", FONT_EXTENSIONS, emitAssets);
10320
+ const assetsFilename = getMergedFilename("assets");
10321
+ chain.output.assetModuleFilename(assetsFilename);
10322
+ if (!emitAssets) {
10323
+ chain.module.generator.merge({ "asset/resource": { emit: false } });
10324
+ }
10302
10325
  });
10303
10326
  }
10304
10327
  });
@@ -10447,13 +10470,15 @@ var init_RsbuildHtmlPlugin = __esm({
10447
10470
  return data;
10448
10471
  };
10449
10472
  addTitleTag = (headTags, title = "") => {
10450
- headTags.unshift({
10451
- tagName: "title",
10452
- innerHTML: title,
10453
- attributes: {},
10454
- voidTag: false,
10455
- meta: {}
10456
- });
10473
+ if (title !== "" && title !== void 0) {
10474
+ headTags.unshift({
10475
+ tagName: "title",
10476
+ innerHTML: title,
10477
+ attributes: {},
10478
+ voidTag: false,
10479
+ meta: {}
10480
+ });
10481
+ }
10457
10482
  };
10458
10483
  RsbuildHtmlPlugin = class {
10459
10484
  constructor(options, getEnvironment, modifyTagsFn) {
@@ -11374,12 +11399,6 @@ var init_swc = __esm({
11374
11399
  const swcConfig = getDefaultSwcConfig(browserslist, cacheRoot);
11375
11400
  applyTransformImport(swcConfig, config.source.transformImport);
11376
11401
  applySwcDecoratorConfig(swcConfig, config);
11377
- if (swcConfig.jsc?.externalHelpers) {
11378
- chain.resolve.alias.set(
11379
- "@swc/helpers",
11380
- import_node_path31.default.dirname(require.resolve("@swc/helpers/package.json"))
11381
- );
11382
- }
11383
11402
  if (isWebTarget(target)) {
11384
11403
  const polyfillMode = config.output.polyfill;
11385
11404
  if (polyfillMode === "off") {
@@ -13537,7 +13556,7 @@ var init_init = __esm({
13537
13556
 
13538
13557
  // src/cli/commands.ts
13539
13558
  function runCli() {
13540
- program.name("rsbuild").usage("<command> [options]").version("1.0.12");
13559
+ program.name("rsbuild").usage("<command> [options]").version("1.0.14");
13541
13560
  const devCommand = program.command("dev");
13542
13561
  const buildCommand = program.command("build");
13543
13562
  const previewCommand = program.command("preview");
@@ -13646,7 +13665,7 @@ function prepareCli() {
13646
13665
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
13647
13666
  console.log();
13648
13667
  }
13649
- import_rslog.logger.greet(` ${`Rsbuild v${"1.0.12"}`}
13668
+ import_rslog.logger.greet(` ${`Rsbuild v${"1.0.14"}`}
13650
13669
  `);
13651
13670
  }
13652
13671
  var import_node_module;
@@ -13732,7 +13751,7 @@ init_logger();
13732
13751
  init_mergeConfig();
13733
13752
  init_helpers();
13734
13753
  init_constants();
13735
- var version = "1.0.12";
13754
+ var version = "1.0.14";
13736
13755
  // Annotate the CommonJS export names for ESM import in node:
13737
13756
  0 && (module.exports = {
13738
13757
  PLUGIN_CSS_NAME,
package/dist/index.js CHANGED
@@ -46,12 +46,12 @@ var __publicField = (obj, key, value) => {
46
46
  return value;
47
47
  };
48
48
 
49
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.60.2_typescript@5.6.2/node_modules/@modern-js/module-tools/shims/esm.js
49
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js
50
50
  import path from "path";
51
51
  import { fileURLToPath } from "url";
52
52
  var getFilename, getDirname, __dirname, __filename;
53
53
  var init_esm = __esm({
54
- "../../node_modules/.pnpm/@modern-js+module-tools@2.60.2_typescript@5.6.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
54
+ "../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js"() {
55
55
  "use strict";
56
56
  getFilename = () => fileURLToPath(import.meta.url);
57
57
  getDirname = () => path.dirname(getFilename());
@@ -3170,7 +3170,7 @@ var init_logger = __esm({
3170
3170
 
3171
3171
  // src/constants.ts
3172
3172
  import { join } from "path";
3173
- var ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
3173
+ var ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, ASSETS_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
3174
3174
  var init_constants = __esm({
3175
3175
  "src/constants.ts"() {
3176
3176
  "use strict";
@@ -3184,6 +3184,7 @@ var init_constants = __esm({
3184
3184
  WASM_DIST_DIR = "static/wasm";
3185
3185
  IMAGE_DIST_DIR = "static/image";
3186
3186
  MEDIA_DIST_DIR = "static/media";
3187
+ ASSETS_DIST_DIR = "static/assets";
3187
3188
  LOADER_PATH = join(__dirname);
3188
3189
  STATIC_PATH = join(__dirname, "../static");
3189
3190
  COMPILED_PATH = join(__dirname, "../compiled");
@@ -3728,6 +3729,8 @@ function getFilename2(config, type, isProd, isServer) {
3728
3729
  return filename.image ?? `[name]${hash}[ext]`;
3729
3730
  case "media":
3730
3731
  return filename.media ?? `[name]${hash}[ext]`;
3732
+ case "assets":
3733
+ return filename.assets ?? `[name]${hash}[ext]`;
3731
3734
  default:
3732
3735
  throw new Error(`unknown key ${type} in "output.filename"`);
3733
3736
  }
@@ -3868,9 +3871,8 @@ var init_helpers = __esm({
3868
3871
  return DEFAULT_ASSET_PREFIX;
3869
3872
  };
3870
3873
  urlJoin = (base, path22) => {
3871
- const fullUrl = new URL(base);
3872
- fullUrl.pathname = posix.join(fullUrl.pathname, path22);
3873
- return fullUrl.toString();
3874
+ const [urlProtocol, baseUrl] = base.split("://");
3875
+ return `${urlProtocol}://${posix.join(baseUrl, path22)}`;
3874
3876
  };
3875
3877
  canParse = (url2) => {
3876
3878
  try {
@@ -4050,7 +4052,7 @@ var init_restart = __esm({
4050
4052
 
4051
4053
  // src/config.ts
4052
4054
  import fs2 from "fs";
4053
- import { isAbsolute as isAbsolute2, join as join3 } from "path";
4055
+ import { dirname, isAbsolute as isAbsolute2, join as join3 } from "path";
4054
4056
  import color5 from "../compiled/picocolors/index.js";
4055
4057
  import RspackChain from "../compiled/rspack-chain/index.js";
4056
4058
  function getDefaultEntry(root) {
@@ -4231,7 +4233,7 @@ function stringifyConfig(config, verbose) {
4231
4233
  const stringify = RspackChain.toString;
4232
4234
  return stringify(config, { verbose });
4233
4235
  }
4234
- var getDefaultDevConfig, getDefaultServerConfig, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
4236
+ var getDefaultDevConfig, getDefaultServerConfig, swcHelpersPath, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
4235
4237
  var init_config = __esm({
4236
4238
  "src/config.ts"() {
4237
4239
  "use strict";
@@ -4266,15 +4268,22 @@ var init_config = __esm({
4266
4268
  printUrls: true,
4267
4269
  strictPort: false
4268
4270
  });
4269
- getDefaultSourceConfig = () => ({
4270
- alias: {},
4271
- define: {},
4272
- aliasStrategy: "prefer-tsconfig",
4273
- preEntry: [],
4274
- decorators: {
4275
- version: "2022-03"
4271
+ getDefaultSourceConfig = () => {
4272
+ if (!swcHelpersPath) {
4273
+ swcHelpersPath = dirname(__require.resolve("@swc/helpers/package.json"));
4276
4274
  }
4277
- });
4275
+ return {
4276
+ alias: {
4277
+ "@swc/helpers": swcHelpersPath
4278
+ },
4279
+ define: {},
4280
+ aliasStrategy: "prefer-tsconfig",
4281
+ preEntry: [],
4282
+ decorators: {
4283
+ version: "2022-03"
4284
+ }
4285
+ };
4286
+ };
4278
4287
  getDefaultHtmlConfig = () => ({
4279
4288
  meta: {
4280
4289
  charset: { charset: "UTF-8" },
@@ -4322,7 +4331,8 @@ var init_config = __esm({
4322
4331
  html: HTML_DIST_DIR,
4323
4332
  wasm: WASM_DIST_DIR,
4324
4333
  image: IMAGE_DIST_DIR,
4325
- media: MEDIA_DIST_DIR
4334
+ media: MEDIA_DIST_DIR,
4335
+ assets: ASSETS_DIST_DIR
4326
4336
  },
4327
4337
  // Temporary placeholder, default: `${server.base}`
4328
4338
  assetPrefix: DEFAULT_ASSET_PREFIX,
@@ -6054,7 +6064,7 @@ async function createContext(options, userConfig, bundlerType) {
6054
6064
  const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
6055
6065
  const cachePath = join6(rootPath, "node_modules", ".cache");
6056
6066
  return {
6057
- version: "1.0.12",
6067
+ version: "1.0.14",
6058
6068
  rootPath,
6059
6069
  distPath: "",
6060
6070
  cachePath,
@@ -9693,7 +9703,7 @@ async function applyCSSRule({
9693
9703
  rule.merge({ sideEffects: true });
9694
9704
  rule.resolve.preferRelative(true);
9695
9705
  }
9696
- var import_deepmerge2, isUseCssExtract, getCSSModulesLocalIdentName, normalizeCssLoaderOptions, userPostcssrcCache, clonePostCSSConfig, getPostcssLoaderOptions, getCSSLoaderOptions, pluginCss;
9706
+ var import_deepmerge2, isUseCssExtract, getCSSModulesLocalIdentName, normalizeCssLoaderOptions, userPostcssrcCache, clonePostCSSConfig, isPostcssPluginCreator, getPostcssLoaderOptions, getCSSLoaderOptions, pluginCss;
9697
9707
  var init_css = __esm({
9698
9708
  "src/plugins/css.ts"() {
9699
9709
  "use strict";
@@ -9734,6 +9744,7 @@ var init_css = __esm({
9734
9744
  ...config,
9735
9745
  plugins: config.plugins ? [...config.plugins] : void 0
9736
9746
  });
9747
+ isPostcssPluginCreator = (plugin) => typeof plugin === "function" && plugin.postcss === true;
9737
9748
  getPostcssLoaderOptions = async ({
9738
9749
  config,
9739
9750
  root
@@ -9755,17 +9766,21 @@ var init_css = __esm({
9755
9766
  postcssOptions: userPostcssConfig,
9756
9767
  sourceMap: config.output.sourceMap.css
9757
9768
  };
9758
- const mergedConfig = reduceConfigsWithContext({
9769
+ const merged = reduceConfigsWithContext({
9759
9770
  initial: defaultPostcssConfig,
9760
9771
  config: config.tools.postcss,
9761
9772
  ctx: utils
9762
9773
  });
9774
+ merged.postcssOptions ||= {};
9775
+ merged.postcssOptions.plugins ||= [];
9763
9776
  if (extraPlugins.length) {
9764
- mergedConfig?.postcssOptions?.plugins.push(...extraPlugins);
9777
+ merged.postcssOptions.plugins.push(...extraPlugins);
9765
9778
  }
9766
- mergedConfig.postcssOptions ||= {};
9767
- mergedConfig.postcssOptions.config = false;
9768
- return mergedConfig;
9779
+ merged.postcssOptions.plugins = merged.postcssOptions.plugins.map(
9780
+ (plugin) => isPostcssPluginCreator(plugin) ? plugin() : plugin
9781
+ );
9782
+ merged.postcssOptions.config = false;
9783
+ return merged;
9769
9784
  };
9770
9785
  getCSSLoaderOptions = ({
9771
9786
  config,
@@ -10361,10 +10376,13 @@ var init_asset = __esm({
10361
10376
  setup(api) {
10362
10377
  api.modifyBundlerChain((chain, { isProd, environment }) => {
10363
10378
  const { config } = environment;
10364
- const createAssetRule = (assetType, exts, emit) => {
10365
- const regExp = getRegExpForExts(exts);
10379
+ const getMergedFilename = (assetType) => {
10366
10380
  const distDir = config.output.distPath[assetType];
10367
10381
  const filename = getFilename2(config, assetType, isProd);
10382
+ return path12.posix.join(distDir, filename);
10383
+ };
10384
+ const createAssetRule = (assetType, exts, emit) => {
10385
+ const regExp = getRegExpForExts(exts);
10368
10386
  const { dataUriLimit } = config.output;
10369
10387
  const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
10370
10388
  const rule = chain.module.rule(assetType).test(regExp);
@@ -10372,7 +10390,7 @@ var init_asset = __esm({
10372
10390
  emit,
10373
10391
  rule,
10374
10392
  maxSize,
10375
- filename: path12.posix.join(distDir, filename),
10393
+ filename: getMergedFilename(assetType),
10376
10394
  assetType
10377
10395
  });
10378
10396
  };
@@ -10385,6 +10403,11 @@ var init_asset = __esm({
10385
10403
  emitAssets
10386
10404
  );
10387
10405
  createAssetRule("font", FONT_EXTENSIONS, emitAssets);
10406
+ const assetsFilename = getMergedFilename("assets");
10407
+ chain.output.assetModuleFilename(assetsFilename);
10408
+ if (!emitAssets) {
10409
+ chain.module.generator.merge({ "asset/resource": { emit: false } });
10410
+ }
10388
10411
  });
10389
10412
  }
10390
10413
  });
@@ -10534,13 +10557,15 @@ var init_RsbuildHtmlPlugin = __esm({
10534
10557
  return data;
10535
10558
  };
10536
10559
  addTitleTag = (headTags, title = "") => {
10537
- headTags.unshift({
10538
- tagName: "title",
10539
- innerHTML: title,
10540
- attributes: {},
10541
- voidTag: false,
10542
- meta: {}
10543
- });
10560
+ if (title !== "" && title !== void 0) {
10561
+ headTags.unshift({
10562
+ tagName: "title",
10563
+ innerHTML: title,
10564
+ attributes: {},
10565
+ voidTag: false,
10566
+ meta: {}
10567
+ });
10568
+ }
10544
10569
  };
10545
10570
  RsbuildHtmlPlugin = class {
10546
10571
  constructor(options, getEnvironment, modifyTagsFn) {
@@ -11470,12 +11495,6 @@ var init_swc = __esm({
11470
11495
  const swcConfig = getDefaultSwcConfig(browserslist, cacheRoot);
11471
11496
  applyTransformImport(swcConfig, config.source.transformImport);
11472
11497
  applySwcDecoratorConfig(swcConfig, config);
11473
- if (swcConfig.jsc?.externalHelpers) {
11474
- chain.resolve.alias.set(
11475
- "@swc/helpers",
11476
- path17.dirname(__require.resolve("@swc/helpers/package.json"))
11477
- );
11478
- }
11479
11498
  if (isWebTarget(target)) {
11480
11499
  const polyfillMode = config.output.polyfill;
11481
11500
  if (polyfillMode === "off") {
@@ -13655,7 +13674,7 @@ var init_init = __esm({
13655
13674
 
13656
13675
  // src/cli/commands.ts
13657
13676
  function runCli() {
13658
- program.name("rsbuild").usage("<command> [options]").version("1.0.12");
13677
+ program.name("rsbuild").usage("<command> [options]").version("1.0.14");
13659
13678
  const devCommand = program.command("dev");
13660
13679
  const buildCommand = program.command("build");
13661
13680
  const previewCommand = program.command("preview");
@@ -13766,7 +13785,7 @@ function prepareCli() {
13766
13785
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
13767
13786
  console.log();
13768
13787
  }
13769
- logger.greet(` ${`Rsbuild v${"1.0.12"}`}
13788
+ logger.greet(` ${`Rsbuild v${"1.0.14"}`}
13770
13789
  `);
13771
13790
  }
13772
13791
  var init_prepare = __esm({
@@ -13837,7 +13856,7 @@ init_mergeConfig();
13837
13856
  init_helpers();
13838
13857
  init_constants();
13839
13858
  import { rspack as rspack10 } from "@rspack/core";
13840
- var version = "1.0.12";
13859
+ var version = "1.0.14";
13841
13860
  export {
13842
13861
  PLUGIN_CSS_NAME,
13843
13862
  PLUGIN_SWC_NAME,
@@ -7,6 +7,7 @@ export declare const FONT_DIST_DIR = "static/font";
7
7
  export declare const WASM_DIST_DIR = "static/wasm";
8
8
  export declare const IMAGE_DIST_DIR = "static/image";
9
9
  export declare const MEDIA_DIST_DIR = "static/media";
10
+ export declare const ASSETS_DIST_DIR = "static/assets";
10
11
  export declare const LOADER_PATH: string;
11
12
  export declare const STATIC_PATH: string;
12
13
  export declare const COMPILED_PATH: string;
@@ -475,6 +475,11 @@ export type DistPathConfig = {
475
475
  * @default 'static/media'
476
476
  */
477
477
  media?: string;
478
+ /**
479
+ * The output directory of assets, except for above (image, svg, font, html, wasm...)
480
+ * @default 'static/assets'
481
+ */
482
+ assets?: string;
478
483
  };
479
484
  export type FilenameConfig = {
480
485
  /**
@@ -516,6 +521,11 @@ export type FilenameConfig = {
516
521
  * @default '[name].[contenthash:8][ext]'
517
522
  */
518
523
  media?: string;
524
+ /**
525
+ * the name of other assets, except for above (image, svg, font, html, wasm...)
526
+ * @default '[name].[contenthash:8][ext]'
527
+ */
528
+ assets?: string;
519
529
  };
520
530
  export type DataUriLimit = {
521
531
  /** The data URI limit of the SVG image. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,7 +46,7 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "~1.0.9",
49
+ "@rspack/core": "~1.0.10",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.13",
52
52
  "core-js": "~3.38.1"
@@ -85,10 +85,10 @@
85
85
  "rslog": "^1.2.3",
86
86
  "rspack-chain": "^1.0.3",
87
87
  "rspack-manifest-plugin": "5.0.1",
88
- "sirv": "^2.0.4",
88
+ "sirv": "^3.0.0",
89
89
  "style-loader": "3.3.4",
90
90
  "tsc-alias": "^1.8.10",
91
- "typescript": "^5.6.2",
91
+ "typescript": "^5.6.3",
92
92
  "webpack": "^5.95.0",
93
93
  "webpack-bundle-analyzer": "^4.10.2",
94
94
  "webpack-merge": "6.0.1",