@rsbuild/core 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 3408: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 1001: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(1022);
5
+ const loader = __nccwpck_require__(3403);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(4671).defaultGetLocalIdent;
8
+ __nccwpck_require__(7206).defaultGetLocalIdent;
9
9
  },
10
- 1022: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 3403: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(9409));
15
- var _plugins = __nccwpck_require__(6549);
16
- var _utils = __nccwpck_require__(4671);
15
+ var _plugins = __nccwpck_require__(4456);
16
+ var _utils = __nccwpck_require__(7206);
17
17
  function _interopRequireDefault(obj) {
18
18
  return obj && obj.__esModule ? obj : { default: obj };
19
19
  }
@@ -236,7 +236,7 @@
236
236
  callback(null, `${importCode}${moduleCode}${exportCode}`);
237
237
  }
238
238
  },
239
- 6549: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 4456: (__unused_webpack_module, exports, __nccwpck_require__) => {
240
240
  "use strict";
241
241
  Object.defineProperty(exports, "__esModule", { value: true });
242
242
  Object.defineProperty(exports, "icssParser", {
@@ -258,22 +258,22 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(1862),
261
+ __nccwpck_require__(3659),
262
262
  );
263
263
  var _postcssIcssParser = _interopRequireDefault(
264
- __nccwpck_require__(6055),
264
+ __nccwpck_require__(6998),
265
265
  );
266
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7410));
266
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(9777));
267
267
  function _interopRequireDefault(obj) {
268
268
  return obj && obj.__esModule ? obj : { default: obj };
269
269
  }
270
270
  },
271
- 6055: (__unused_webpack_module, exports, __nccwpck_require__) => {
271
+ 6998: (__unused_webpack_module, exports, __nccwpck_require__) => {
272
272
  "use strict";
273
273
  Object.defineProperty(exports, "__esModule", { value: true });
274
274
  exports["default"] = void 0;
275
275
  var _icssUtils = __nccwpck_require__(4531);
276
- var _utils = __nccwpck_require__(4671);
276
+ var _utils = __nccwpck_require__(7206);
277
277
  const plugin = (options = {}) => ({
278
278
  postcssPlugin: "postcss-icss-parser",
279
279
  async OnceExit(root) {
@@ -372,14 +372,14 @@
372
372
  plugin.postcss = true;
373
373
  var _default = (exports["default"] = plugin);
374
374
  },
375
- 1862: (__unused_webpack_module, exports, __nccwpck_require__) => {
375
+ 3659: (__unused_webpack_module, exports, __nccwpck_require__) => {
376
376
  "use strict";
377
377
  Object.defineProperty(exports, "__esModule", { value: true });
378
378
  exports["default"] = void 0;
379
379
  var _postcssValueParser = _interopRequireDefault(
380
380
  __nccwpck_require__(2948),
381
381
  );
382
- var _utils = __nccwpck_require__(4671);
382
+ var _utils = __nccwpck_require__(7206);
383
383
  function _interopRequireDefault(obj) {
384
384
  return obj && obj.__esModule ? obj : { default: obj };
385
385
  }
@@ -684,14 +684,14 @@
684
684
  plugin.postcss = true;
685
685
  var _default = (exports["default"] = plugin);
686
686
  },
687
- 7410: (__unused_webpack_module, exports, __nccwpck_require__) => {
687
+ 9777: (__unused_webpack_module, exports, __nccwpck_require__) => {
688
688
  "use strict";
689
689
  Object.defineProperty(exports, "__esModule", { value: true });
690
690
  exports["default"] = void 0;
691
691
  var _postcssValueParser = _interopRequireDefault(
692
692
  __nccwpck_require__(2948),
693
693
  );
694
- var _utils = __nccwpck_require__(4671);
694
+ var _utils = __nccwpck_require__(7206);
695
695
  function _interopRequireDefault(obj) {
696
696
  return obj && obj.__esModule ? obj : { default: obj };
697
697
  }
@@ -1034,7 +1034,7 @@
1034
1034
  plugin.postcss = true;
1035
1035
  var _default = (exports["default"] = plugin);
1036
1036
  },
1037
- 4671: (__unused_webpack_module, exports, __nccwpck_require__) => {
1037
+ 7206: (__unused_webpack_module, exports, __nccwpck_require__) => {
1038
1038
  "use strict";
1039
1039
  Object.defineProperty(exports, "__esModule", { value: true });
1040
1040
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8098,6 +8098,6 @@
8098
8098
  }
8099
8099
  if (typeof __nccwpck_require__ !== "undefined")
8100
8100
  __nccwpck_require__.ab = __dirname + "/";
8101
- var __webpack_exports__ = __nccwpck_require__(3408);
8101
+ var __webpack_exports__ = __nccwpck_require__(1001);
8102
8102
  module.exports = __webpack_exports__;
8103
8103
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 5: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 386: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(774);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(403);
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
- 774: (module) => {
307
+ 403: (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
- 430: (module) => {
476
+ 369: (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
- 193: (module) => {
495
+ 312: (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
- 984: (module, __unused_webpack_exports, __nccwpck_require__) => {
516
+ 575: (module, __unused_webpack_exports, __nccwpck_require__) => {
517
517
  "use strict";
518
518
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
519
519
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -539,7 +539,7 @@
539
539
  }
540
540
  module.exports = { getHtmlRspackPluginHooks };
541
541
  },
542
- 386: (module) => {
542
+ 654: (module) => {
543
543
  const voidTags = [
544
544
  "area",
545
545
  "base",
@@ -607,19 +607,19 @@
607
607
  htmlTagObjectToString,
608
608
  };
609
609
  },
610
- 904: (module, __unused_webpack_exports, __nccwpck_require__) => {
610
+ 535: (module, __unused_webpack_exports, __nccwpck_require__) => {
611
611
  "use strict";
612
612
  const promisify = __nccwpck_require__(23).promisify;
613
613
  const vm = __nccwpck_require__(154);
614
614
  const fs = __nccwpck_require__(896);
615
615
  const path = __nccwpck_require__(928);
616
- const { CachedChildCompilation } = __nccwpck_require__(5);
616
+ const { CachedChildCompilation } = __nccwpck_require__(386);
617
617
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
618
- __nccwpck_require__(386);
619
- const prettyError = __nccwpck_require__(193);
620
- const chunkSorter = __nccwpck_require__(430);
618
+ __nccwpck_require__(654);
619
+ const prettyError = __nccwpck_require__(312);
620
+ const chunkSorter = __nccwpck_require__(369);
621
621
  const getHtmlRspackPluginHooks =
622
- __nccwpck_require__(984).getHtmlRspackPluginHooks;
622
+ __nccwpck_require__(575).getHtmlRspackPluginHooks;
623
623
  class HtmlRspackPlugin {
624
624
  constructor(userOptions = {}) {
625
625
  this.version = HtmlRspackPlugin.version;
@@ -1586,6 +1586,6 @@
1586
1586
  }
1587
1587
  if (typeof __nccwpck_require__ !== "undefined")
1588
1588
  __nccwpck_require__.ab = __dirname + "/";
1589
- var __webpack_exports__ = __nccwpck_require__(904);
1589
+ var __webpack_exports__ = __nccwpck_require__(535);
1590
1590
  module.exports = __webpack_exports__;
1591
1591
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 459: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(141)["default"];
4
+ 31: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(785)["default"];
6
6
  },
7
- 141: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 785: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = loader;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(928));
12
- var _utils = __nccwpck_require__(368);
12
+ var _utils = __nccwpck_require__(164);
13
13
  function _interopRequireDefault(obj) {
14
14
  return obj && obj.__esModule ? obj : { default: obj };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 368: (module, exports, __nccwpck_require__) => {
182
+ 164: (module, exports, __nccwpck_require__) => {
183
183
  module = __nccwpck_require__.nmd(module);
184
184
  Object.defineProperty(exports, "__esModule", { value: true });
185
185
  exports.exec = exec;
@@ -716,6 +716,6 @@
716
716
  })();
717
717
  if (typeof __nccwpck_require__ !== "undefined")
718
718
  __nccwpck_require__.ab = __dirname + "/";
719
- var __webpack_exports__ = __nccwpck_require__(459);
719
+ var __webpack_exports__ = __nccwpck_require__(31);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 828: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 481: (__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
- 253: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 740: (__unused_webpack_module, exports, __nccwpck_require__) => {
124
124
  Object.defineProperty(exports, "__esModule", { value: true });
125
125
  exports.normalModuleLoaderHook =
126
126
  exports.getCompilerHooks =
@@ -130,7 +130,7 @@
130
130
  const fs_1 = __nccwpck_require__(896);
131
131
  const path_1 = __nccwpck_require__(928);
132
132
  const lite_tapable_1 = __nccwpck_require__(408);
133
- const helpers_1 = __nccwpck_require__(828);
133
+ const helpers_1 = __nccwpck_require__(481);
134
134
  const compilerHookMap = new WeakMap();
135
135
  const getCompilerHooks = (compiler) => {
136
136
  let hooks = compilerHookMap.get(compiler);
@@ -312,7 +312,7 @@
312
312
  exports.getCompilerHooks =
313
313
  void 0;
314
314
  const path_1 = __nccwpck_require__(928);
315
- const hooks_1 = __nccwpck_require__(253);
315
+ const hooks_1 = __nccwpck_require__(740);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
package/dist/index.cjs CHANGED
@@ -2207,7 +2207,7 @@ for(var __webpack_i__ in (()=>{
2207
2207
  async function createContext(options, userConfig) {
2208
2208
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
2209
2209
  return {
2210
- version: "1.3.2",
2210
+ version: "1.3.4",
2211
2211
  rootPath,
2212
2212
  distPath: '',
2213
2213
  cachePath,
@@ -2248,36 +2248,28 @@ for(var __webpack_i__ in (()=>{
2248
2248
  setup (api) {
2249
2249
  let htmlTagsMap = new Map(), iconFormatMap = new Map(), formatIcon = (icon, distDir, publicPath)=>{
2250
2250
  let { src, size } = icon, cached = iconFormatMap.get(src);
2251
- if (cached) return {
2252
- ...cached,
2253
- ...icon
2254
- };
2251
+ if (cached) return cached;
2255
2252
  let sizes = `${size}x${size}`;
2256
2253
  if (isURL(src)) {
2257
- let paths = {
2254
+ let formatted = {
2255
+ ...icon,
2256
+ src,
2258
2257
  sizes,
2259
2258
  isURL: !0,
2260
- requestPath: src,
2261
- absolutePath: src,
2262
- relativePath: src,
2263
2259
  mimeType: (0, mrmime_index_js_namespaceObject.lookup)(src)
2264
2260
  };
2265
- return iconFormatMap.set(src, paths), {
2266
- ...paths,
2267
- ...icon
2268
- };
2261
+ return iconFormatMap.set(src, formatted), formatted;
2269
2262
  }
2270
- let absolutePath = external_node_path_default().isAbsolute(src) ? src : external_node_path_default().join(api.context.rootPath, src), relativePath = external_node_path_default().posix.join(distDir, external_node_path_default().basename(absolutePath)), paths = {
2263
+ let absolutePath = external_node_path_default().isAbsolute(src) ? src : external_node_path_default().join(api.context.rootPath, src), relativePath = external_node_path_default().posix.join(distDir, external_node_path_default().basename(absolutePath)), formatted = {
2264
+ ...icon,
2271
2265
  sizes,
2272
- requestPath: ensureAssetPrefix(relativePath, publicPath),
2266
+ src: ensureAssetPrefix(relativePath, publicPath),
2267
+ isURL: !1,
2273
2268
  absolutePath,
2274
2269
  relativePath,
2275
2270
  mimeType: (0, mrmime_index_js_namespaceObject.lookup)(absolutePath)
2276
2271
  };
2277
- return iconFormatMap.set(src, paths), {
2278
- ...paths,
2279
- ...icon
2280
- };
2272
+ return iconFormatMap.set(src, formatted), formatted;
2281
2273
  };
2282
2274
  api.processAssets({
2283
2275
  stage: 'additional'
@@ -2311,14 +2303,14 @@ for(var __webpack_i__ in (()=>{
2311
2303
  attrs: {
2312
2304
  rel: 'apple-touch-icon',
2313
2305
  sizes: icon.sizes,
2314
- href: icon.requestPath
2306
+ href: icon.src
2315
2307
  }
2316
2308
  });
2317
2309
  }
2318
2310
  if (appIcon.name) {
2319
2311
  let manifestIcons = icons.filter((icon)=>'web-app-manifest' === icon.target || !icon.target).map((icon)=>{
2320
2312
  let result = {
2321
- src: icon.requestPath,
2313
+ src: icon.src,
2322
2314
  sizes: icon.sizes
2323
2315
  };
2324
2316
  return icon.mimeType ? {
@@ -2344,9 +2336,11 @@ for(var __webpack_i__ in (()=>{
2344
2336
  headTags,
2345
2337
  bodyTags
2346
2338
  };
2347
- }), api.onCloseDevServer(()=>{
2348
- htmlTagsMap.clear(), iconFormatMap.clear();
2349
2339
  });
2340
+ let clean = ()=>{
2341
+ htmlTagsMap.clear(), iconFormatMap.clear();
2342
+ };
2343
+ api.onCloseDevServer(clean), api.onCloseBuild(clean);
2350
2344
  }
2351
2345
  });
2352
2346
  async function modifyBundlerChain(context, utils) {
@@ -2392,6 +2386,7 @@ for(var __webpack_i__ in (()=>{
2392
2386
  },
2393
2387
  ONE_OF: {
2394
2388
  SVG: 'svg',
2389
+ SVG_RAW: 'svg-asset-raw',
2395
2390
  SVG_URL: 'svg-asset-url',
2396
2391
  SVG_ASSET: 'svg-asset',
2397
2392
  SVG_REACT: 'svg-react',
@@ -3008,7 +3003,8 @@ for(var __webpack_i__ in (()=>{
3008
3003
  var external_node_zlib_default = __webpack_require__.n(external_node_zlib_namespaceObject);
3009
3004
  let fileSize_gzip = (0, external_node_util_namespaceObject.promisify)(external_node_zlib_default().gzip);
3010
3005
  async function gzipSize(input) {
3011
- return (await fileSize_gzip(input)).length;
3006
+ let data = await fileSize_gzip(input);
3007
+ return Buffer.byteLength(data);
3012
3008
  }
3013
3009
  let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.ts)$/, excludeAsset = (asset)=>EXCLUDE_ASSET_REGEX.test(asset.name), getAssetColor = (size)=>size > 300000 ? index_js_default().red : size > 100000 ? index_js_default().yellow : index_js_default().green, calcFileSize = (len)=>{
3014
3010
  let val = len / 1000;
@@ -3018,7 +3014,7 @@ for(var __webpack_i__ in (()=>{
3018
3014
  let logs = [];
3019
3015
  if (!1 === options.detail && !1 === options.total) return logs;
3020
3016
  let formatAsset = async (asset, distPath, distFolder)=>{
3021
- let fileName = asset.name.split('?')[0], contents = await external_node_fs_default().promises.readFile(external_node_path_default().join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
3017
+ let fileName = asset.name.split('?')[0], contents = await external_node_fs_default().promises.readFile(external_node_path_default().join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
3022
3018
  return {
3023
3019
  size,
3024
3020
  folder: external_node_path_default().join(distFolder, external_node_path_default().dirname(fileName)),
@@ -3894,18 +3890,15 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
3894
3890
  'Brave Browser',
3895
3891
  'Vivaldi',
3896
3892
  'Chromium'
3897
- ], getTargetBrowser = async ()=>{
3898
- let targetBrowser = process.env.BROWSER;
3899
- if (!targetBrowser || !supportedChromiumBrowsers.includes(targetBrowser)) {
3900
- let { stdout: ps } = await execAsync('ps cax');
3901
- targetBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
3902
- }
3903
- return targetBrowser;
3904
- };
3893
+ ], getDefaultBrowserForAppleScript = async ()=>{
3894
+ let { stdout: ps } = await execAsync('ps cax');
3895
+ return supportedChromiumBrowsers.find((b)=>ps.includes(b));
3896
+ }, mapChromiumBrowserName = (browser)=>'chrome' === browser || 'google chrome' === browser ? 'Google Chrome' : browser, shouldTryAppleScript = (browser, browserArgs)=>'darwin' === process.platform && (!browser || !browserArgs) && (!browser || supportedChromiumBrowsers.includes(mapChromiumBrowserName(browser)));
3905
3897
  async function openBrowser(url) {
3906
- if ('darwin' === process.platform) try {
3907
- let targetBrowser = await getTargetBrowser();
3908
- if (targetBrowser) return await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${targetBrowser}"`, {
3898
+ let browser = process.env.BROWSER, browserArgs = process.env.BROWSER_ARGS;
3899
+ if (shouldTryAppleScript(browser, browserArgs)) try {
3900
+ let chromiumBrowser = browser ? mapChromiumBrowserName(browser) : await getDefaultBrowserForAppleScript();
3901
+ if (chromiumBrowser) return await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${chromiumBrowser}"`, {
3909
3902
  cwd: STATIC_PATH
3910
3903
  }), !0;
3911
3904
  rslog_index_js_namespaceObject.logger.debug('failed to find the target browser.');
@@ -3913,8 +3906,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
3913
3906
  rslog_index_js_namespaceObject.logger.debug("failed to open start URL with apple script."), rslog_index_js_namespaceObject.logger.debug(err);
3914
3907
  }
3915
3908
  try {
3916
- let { default: open } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/open/index.js"));
3917
- return await open(url), !0;
3909
+ let { default: open } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/open/index.js")), { apps } = open, options = browser ? {
3910
+ app: {
3911
+ name: apps[browser] ?? browser,
3912
+ arguments: null == browserArgs ? void 0 : browserArgs.split(' ')
3913
+ }
3914
+ } : {};
3915
+ return await open(url, options), !0;
3918
3916
  } catch (err) {
3919
3917
  return rslog_index_js_namespaceObject.logger.error('Failed to open start URL.'), rslog_index_js_namespaceObject.logger.error(err), !1;
3920
3918
  }
@@ -4957,7 +4955,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4957
4955
  cwd: root,
4958
4956
  rsbuildConfig: ()=>init_loadConfig(root),
4959
4957
  environment: commonOpts.environment,
4960
- loadEnv: {
4958
+ loadEnv: !1 !== commonOpts.env && {
4961
4959
  cwd: getEnvDir(root, commonOpts.envDir),
4962
4960
  mode: commonOpts.envMode
4963
4961
  }
@@ -5902,17 +5900,16 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
5902
5900
  };
5903
5901
  }, external_node_vm_namespaceObject = require("node:vm");
5904
5902
  var external_node_vm_default = __webpack_require__.n(external_node_vm_namespaceObject);
5905
- let SYNTHETIC_MODULES_STORE = '__SYNTHETIC_MODULES_STORE', asModule = async (something, context, unlinked)=>{
5903
+ let asModule = async (something, context, unlinked)=>{
5906
5904
  if (something instanceof external_node_vm_default().Module) return something;
5907
- context[SYNTHETIC_MODULES_STORE] = context[SYNTHETIC_MODULES_STORE] || [];
5908
- let i = context[SYNTHETIC_MODULES_STORE].length;
5909
- context[SYNTHETIC_MODULES_STORE].push(something);
5910
- let code = [
5905
+ let exports1 = [
5911
5906
  ...new Set([
5912
5907
  'default',
5913
5908
  ...Object.keys(something)
5914
5909
  ])
5915
- ].map((name)=>`const _${name} = ${SYNTHETIC_MODULES_STORE}[${i}]${'default' === name ? '' : `[${JSON.stringify(name)}]`}; export { _${name} as ${name}};`).join('\n'), m = new (external_node_vm_default()).SourceTextModule(code, {
5910
+ ], m = new (external_node_vm_default()).SyntheticModule(exports1, ()=>{
5911
+ for (let name of exports1)m.setExport(name, 'default' === name ? something : something[name]);
5912
+ }, {
5916
5913
  context
5917
5914
  });
5918
5915
  return unlinked || (await m.link(()=>{}), m.instantiate && m.instantiate(), await m.evaluate()), m;
@@ -6062,9 +6059,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6062
6059
  });
6063
6060
  }
6064
6061
  createEsmRequirer() {
6065
- let esmContext = external_node_vm_default().createContext(this.baseModuleScope, {
6066
- name: 'context for esm'
6067
- }), esmCache = new Map(), esmIdentifier = this._options.name;
6062
+ let esmCache = new Map(), esmIdentifier = this._options.name;
6068
6063
  return (currentDirectory, modulePath, context = {})=>{
6069
6064
  if (!external_node_vm_default().SourceTextModule) throw Error('[rsbuild:runner] Running ESM bundle needs add Node.js option "--experimental-vm-modules".');
6070
6065
  let _require = this.getRequire(), file = context.file || this.getFile(modulePath, currentDirectory);
@@ -6073,7 +6068,6 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
6073
6068
  return (esm || (esm = new (external_node_vm_default()).SourceTextModule(file.content, {
6074
6069
  identifier: `${esmIdentifier}-${file.path}`,
6075
6070
  url: `${(0, external_node_url_namespaceObject.pathToFileURL)(file.path).href}?${esmIdentifier}`,
6076
- context: esmContext,
6077
6071
  initializeImportMeta: (meta, _)=>{
6078
6072
  meta.url = (0, external_node_url_namespaceObject.pathToFileURL)(file.path).href;
6079
6073
  },
@@ -7394,7 +7388,7 @@ ${section.body}` : section.body).join("\n\n"));
7394
7388
  String
7395
7389
  ],
7396
7390
  default: []
7397
- }).option('--env-dir <dir>', 'specify the directory to load `.env` files');
7391
+ }).option('--env-dir <dir>', 'specify the directory to load `.env` files').option('--no-env', 'Disable loading `.env` files');
7398
7392
  }, applyServerOptions = (command)=>{
7399
7393
  command.option('-o, --open [url]', 'open the page in browser on startup').option('--port <port>', 'specify a port number for server to listen').option('--host <host>', 'specify the host that the server listens to');
7400
7394
  };
@@ -7408,11 +7402,11 @@ ${section.body}` : section.body).join("\n\n"));
7408
7402
  }
7409
7403
  process.title = 'rsbuild-node';
7410
7404
  let { npm_execpath } = process.env;
7411
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.2\n`);
7405
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.4\n`);
7412
7406
  try {
7413
7407
  !function() {
7414
7408
  let cli = cac_dist('rsbuild');
7415
- cli.help(), cli.version("1.3.2"), applyCommonOptions(cli);
7409
+ cli.help(), cli.version("1.3.4"), applyCommonOptions(cli);
7416
7410
  let devCommand = cli.command('', 'starting the dev server').alias('dev'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
7417
7411
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
7418
7412
  try {
@@ -7463,7 +7457,7 @@ ${section.body}` : section.body).join("\n\n"));
7463
7457
  rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
7464
7458
  }
7465
7459
  }
7466
- let src_rslib_entry_version = "1.3.2";
7460
+ let src_rslib_entry_version = "1.3.4";
7467
7461
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
7468
7462
  "PLUGIN_CSS_NAME",
7469
7463
  "PLUGIN_SWC_NAME",
package/dist/index.js CHANGED
@@ -2107,7 +2107,7 @@ async function updateEnvironmentContext(context, configs) {
2107
2107
  async function createContext(options, userConfig) {
2108
2108
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
2109
2109
  return {
2110
- version: "1.3.2",
2110
+ version: "1.3.4",
2111
2111
  rootPath,
2112
2112
  distPath: '',
2113
2113
  cachePath,
@@ -2148,36 +2148,28 @@ let pluginAppIcon = ()=>({
2148
2148
  setup (api) {
2149
2149
  let htmlTagsMap = new Map(), iconFormatMap = new Map(), formatIcon = (icon, distDir, publicPath)=>{
2150
2150
  let { src, size } = icon, cached = iconFormatMap.get(src);
2151
- if (cached) return {
2152
- ...cached,
2153
- ...icon
2154
- };
2151
+ if (cached) return cached;
2155
2152
  let sizes = `${size}x${size}`;
2156
2153
  if (isURL(src)) {
2157
- let paths = {
2154
+ let formatted = {
2155
+ ...icon,
2156
+ src,
2158
2157
  sizes,
2159
2158
  isURL: !0,
2160
- requestPath: src,
2161
- absolutePath: src,
2162
- relativePath: src,
2163
2159
  mimeType: (0, __WEBPACK_EXTERNAL_MODULE__compiled_mrmime_index_js_86f064ca__.lookup)(src)
2164
2160
  };
2165
- return iconFormatMap.set(src, paths), {
2166
- ...paths,
2167
- ...icon
2168
- };
2161
+ return iconFormatMap.set(src, formatted), formatted;
2169
2162
  }
2170
- let absolutePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.isAbsolute(src) ? src : __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(api.context.rootPath, src), relativePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.posix.join(distDir, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.basename(absolutePath)), paths = {
2163
+ let absolutePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.isAbsolute(src) ? src : __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(api.context.rootPath, src), relativePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.posix.join(distDir, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.basename(absolutePath)), formatted = {
2164
+ ...icon,
2171
2165
  sizes,
2172
- requestPath: ensureAssetPrefix(relativePath, publicPath),
2166
+ src: ensureAssetPrefix(relativePath, publicPath),
2167
+ isURL: !1,
2173
2168
  absolutePath,
2174
2169
  relativePath,
2175
2170
  mimeType: (0, __WEBPACK_EXTERNAL_MODULE__compiled_mrmime_index_js_86f064ca__.lookup)(absolutePath)
2176
2171
  };
2177
- return iconFormatMap.set(src, paths), {
2178
- ...paths,
2179
- ...icon
2180
- };
2172
+ return iconFormatMap.set(src, formatted), formatted;
2181
2173
  };
2182
2174
  api.processAssets({
2183
2175
  stage: 'additional'
@@ -2211,14 +2203,14 @@ let pluginAppIcon = ()=>({
2211
2203
  attrs: {
2212
2204
  rel: 'apple-touch-icon',
2213
2205
  sizes: icon.sizes,
2214
- href: icon.requestPath
2206
+ href: icon.src
2215
2207
  }
2216
2208
  });
2217
2209
  }
2218
2210
  if (appIcon.name) {
2219
2211
  let manifestIcons = icons.filter((icon)=>'web-app-manifest' === icon.target || !icon.target).map((icon)=>{
2220
2212
  let result = {
2221
- src: icon.requestPath,
2213
+ src: icon.src,
2222
2214
  sizes: icon.sizes
2223
2215
  };
2224
2216
  return icon.mimeType ? {
@@ -2244,9 +2236,11 @@ let pluginAppIcon = ()=>({
2244
2236
  headTags,
2245
2237
  bodyTags
2246
2238
  };
2247
- }), api.onCloseDevServer(()=>{
2248
- htmlTagsMap.clear(), iconFormatMap.clear();
2249
2239
  });
2240
+ let clean = ()=>{
2241
+ htmlTagsMap.clear(), iconFormatMap.clear();
2242
+ };
2243
+ api.onCloseDevServer(clean), api.onCloseBuild(clean);
2250
2244
  }
2251
2245
  });
2252
2246
  async function modifyBundlerChain(context, utils) {
@@ -2292,6 +2286,7 @@ let configChain_CHAIN_ID = {
2292
2286
  },
2293
2287
  ONE_OF: {
2294
2288
  SVG: 'svg',
2289
+ SVG_RAW: 'svg-asset-raw',
2295
2290
  SVG_URL: 'svg-asset-url',
2296
2291
  SVG_ASSET: 'svg-asset',
2297
2292
  SVG_REACT: 'svg-react',
@@ -2905,7 +2900,8 @@ let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plu
2905
2900
  }
2906
2901
  }), fileSize_gzip = (0, __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__.promisify)(__WEBPACK_EXTERNAL_MODULE_node_zlib_a5bb16fc__.default.gzip);
2907
2902
  async function gzipSize(input) {
2908
- return (await fileSize_gzip(input)).length;
2903
+ let data = await fileSize_gzip(input);
2904
+ return Buffer.byteLength(data);
2909
2905
  }
2910
2906
  let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.ts)$/, excludeAsset = (asset)=>EXCLUDE_ASSET_REGEX.test(asset.name), getAssetColor = (size)=>size > 300000 ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.red : size > 100000 ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow : __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green, calcFileSize = (len)=>{
2911
2907
  let val = len / 1000;
@@ -2915,7 +2911,7 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
2915
2911
  let logs = [];
2916
2912
  if (!1 === options.detail && !1 === options.total) return logs;
2917
2913
  let formatAsset = async (asset, distPath, distFolder)=>{
2918
- let fileName = asset.name.split('?')[0], contents = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2914
+ let fileName = asset.name.split('?')[0], contents = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2919
2915
  return {
2920
2916
  size,
2921
2917
  folder: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distFolder, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.dirname(fileName)),
@@ -3785,18 +3781,15 @@ let execAsync = (0, __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__.promisify)(__
3785
3781
  'Brave Browser',
3786
3782
  'Vivaldi',
3787
3783
  'Chromium'
3788
- ], getTargetBrowser = async ()=>{
3789
- let targetBrowser = process.env.BROWSER;
3790
- if (!targetBrowser || !supportedChromiumBrowsers.includes(targetBrowser)) {
3791
- let { stdout: ps } = await execAsync('ps cax');
3792
- targetBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
3793
- }
3794
- return targetBrowser;
3795
- };
3784
+ ], getDefaultBrowserForAppleScript = async ()=>{
3785
+ let { stdout: ps } = await execAsync('ps cax');
3786
+ return supportedChromiumBrowsers.find((b)=>ps.includes(b));
3787
+ }, mapChromiumBrowserName = (browser)=>'chrome' === browser || 'google chrome' === browser ? 'Google Chrome' : browser, shouldTryAppleScript = (browser, browserArgs)=>'darwin' === process.platform && (!browser || !browserArgs) && (!browser || supportedChromiumBrowsers.includes(mapChromiumBrowserName(browser)));
3796
3788
  async function openBrowser(url) {
3797
- if ('darwin' === process.platform) try {
3798
- let targetBrowser = await getTargetBrowser();
3799
- if (targetBrowser) return await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${targetBrowser}"`, {
3789
+ let browser = process.env.BROWSER, browserArgs = process.env.BROWSER_ARGS;
3790
+ if (shouldTryAppleScript(browser, browserArgs)) try {
3791
+ let chromiumBrowser = browser ? mapChromiumBrowserName(browser) : await getDefaultBrowserForAppleScript();
3792
+ if (chromiumBrowser) return await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${chromiumBrowser}"`, {
3800
3793
  cwd: STATIC_PATH
3801
3794
  }), !0;
3802
3795
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('failed to find the target browser.');
@@ -3804,8 +3797,13 @@ async function openBrowser(url) {
3804
3797
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug("failed to open start URL with apple script."), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug(err);
3805
3798
  }
3806
3799
  try {
3807
- let { default: open } = await import("../compiled/open/index.js");
3808
- return await open(url), !0;
3800
+ let { default: open } = await import("../compiled/open/index.js"), { apps } = open, options = browser ? {
3801
+ app: {
3802
+ name: apps[browser] ?? browser,
3803
+ arguments: null == browserArgs ? void 0 : browserArgs.split(' ')
3804
+ }
3805
+ } : {};
3806
+ return await open(url, options), !0;
3809
3807
  } catch (err) {
3810
3808
  return __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to open start URL.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err), !1;
3811
3809
  }
@@ -4842,7 +4840,7 @@ async function init({ cliOptions, isRestart, isBuildWatch = !1 }) {
4842
4840
  cwd: root,
4843
4841
  rsbuildConfig: ()=>init_loadConfig(root),
4844
4842
  environment: commonOpts.environment,
4845
- loadEnv: {
4843
+ loadEnv: !1 !== commonOpts.env && {
4846
4844
  cwd: getEnvDir(root, commonOpts.envDir),
4847
4845
  mode: commonOpts.envMode
4848
4846
  }
@@ -5781,17 +5779,16 @@ let ENCODING_REGEX = /\bgzip\b/, CONTENT_TYPE_REGEX = /text|javascript|\/json|xm
5781
5779
  onUpgrade,
5782
5780
  middlewares
5783
5781
  };
5784
- }, SYNTHETIC_MODULES_STORE = '__SYNTHETIC_MODULES_STORE', asModule = async (something, context, unlinked)=>{
5782
+ }, asModule = async (something, context, unlinked)=>{
5785
5783
  if (something instanceof __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.Module) return something;
5786
- context[SYNTHETIC_MODULES_STORE] = context[SYNTHETIC_MODULES_STORE] || [];
5787
- let i = context[SYNTHETIC_MODULES_STORE].length;
5788
- context[SYNTHETIC_MODULES_STORE].push(something);
5789
- let code = [
5784
+ let exports = [
5790
5785
  ...new Set([
5791
5786
  'default',
5792
5787
  ...Object.keys(something)
5793
5788
  ])
5794
- ].map((name)=>`const _${name} = ${SYNTHETIC_MODULES_STORE}[${i}]${'default' === name ? '' : `[${JSON.stringify(name)}]`}; export { _${name} as ${name}};`).join('\n'), m = new __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.SourceTextModule(code, {
5789
+ ], m = new __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.SyntheticModule(exports, ()=>{
5790
+ for (let name of exports)m.setExport(name, 'default' === name ? something : something[name]);
5791
+ }, {
5795
5792
  context
5796
5793
  });
5797
5794
  return unlinked || (await m.link(()=>{}), m.instantiate && m.instantiate(), await m.evaluate()), m;
@@ -5939,9 +5936,7 @@ class EsmRunner extends CommonJsRunner {
5939
5936
  });
5940
5937
  }
5941
5938
  createEsmRequirer() {
5942
- let esmContext = __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.createContext(this.baseModuleScope, {
5943
- name: 'context for esm'
5944
- }), esmCache = new Map(), esmIdentifier = this._options.name;
5939
+ let esmCache = new Map(), esmIdentifier = this._options.name;
5945
5940
  return (currentDirectory, modulePath, context = {})=>{
5946
5941
  if (!__WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.SourceTextModule) throw Error('[rsbuild:runner] Running ESM bundle needs add Node.js option "--experimental-vm-modules".');
5947
5942
  let _require = this.getRequire(), file = context.file || this.getFile(modulePath, currentDirectory);
@@ -5950,7 +5945,6 @@ class EsmRunner extends CommonJsRunner {
5950
5945
  return (esm || (esm = new __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__.default.SourceTextModule(file.content, {
5951
5946
  identifier: `${esmIdentifier}-${file.path}`,
5952
5947
  url: `${(0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.pathToFileURL)(file.path).href}?${esmIdentifier}`,
5953
- context: esmContext,
5954
5948
  initializeImportMeta: (meta, _)=>{
5955
5949
  meta.url = (0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.pathToFileURL)(file.path).href;
5956
5950
  },
@@ -7268,7 +7262,7 @@ let cac_dist = (name = "")=>new CAC(name), applyCommonOptions = (cli)=>{
7268
7262
  String
7269
7263
  ],
7270
7264
  default: []
7271
- }).option('--env-dir <dir>', 'specify the directory to load `.env` files');
7265
+ }).option('--env-dir <dir>', 'specify the directory to load `.env` files').option('--no-env', 'Disable loading `.env` files');
7272
7266
  }, applyServerOptions = (command)=>{
7273
7267
  command.option('-o, --open [url]', 'open the page in browser on startup').option('--port <port>', 'specify a port number for server to listen').option('--host <host>', 'specify the host that the server listens to');
7274
7268
  };
@@ -7282,11 +7276,11 @@ async function runCLI() {
7282
7276
  }
7283
7277
  process.title = 'rsbuild-node';
7284
7278
  let { npm_execpath } = process.env;
7285
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.3.2\n`);
7279
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.3.4\n`);
7286
7280
  try {
7287
7281
  !function() {
7288
7282
  let cli = cac_dist('rsbuild');
7289
- cli.help(), cli.version("1.3.2"), applyCommonOptions(cli);
7283
+ cli.help(), cli.version("1.3.4"), applyCommonOptions(cli);
7290
7284
  let devCommand = cli.command('', 'starting the dev server').alias('dev'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
7291
7285
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
7292
7286
  try {
@@ -7337,6 +7331,6 @@ async function runCLI() {
7337
7331
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
7338
7332
  }
7339
7333
  }
7340
- let src_version = "1.3.2";
7334
+ let src_version = "1.3.4";
7341
7335
  var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
7342
7336
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
@@ -6,6 +6,7 @@ export type CommonOptions = {
6
6
  mode?: RsbuildMode;
7
7
  config?: string;
8
8
  configLoader?: ConfigLoader;
9
+ env?: boolean;
9
10
  envDir?: string;
10
11
  envMode?: string;
11
12
  open?: boolean | string;
@@ -58,6 +58,7 @@ export declare const CHAIN_ID: {
58
58
  /** Predefined rule groups */
59
59
  readonly ONE_OF: {
60
60
  readonly SVG: "svg";
61
+ readonly SVG_RAW: "svg-asset-raw";
61
62
  readonly SVG_URL: "svg-asset-url";
62
63
  readonly SVG_ASSET: "svg-asset";
63
64
  readonly SVG_REACT: "svg-react";
@@ -127,15 +127,8 @@ export type ResolvedCreateRsbuildOptions = Required<Pick<CreateRsbuildOptions, '
127
127
  };
128
128
  export type CreateDevServer = (options?: CreateDevServerOptions) => Promise<RsbuildDevServer>;
129
129
  export type StartDevServer = (options?: StartDevServerOptions) => Promise<StartServerResult>;
130
- export type ProviderInstance<B extends 'rspack' | 'webpack' = 'rspack'> = {
130
+ export type ProviderInstance<B extends 'rspack' | 'webpack' = 'rspack'> = Pick<RsbuildInstance, 'build' | 'createCompiler' | 'createDevServer' | 'startDevServer'> & {
131
131
  readonly bundler: Bundler;
132
- createCompiler: CreateCompiler;
133
- /**
134
- * It is designed for higher-level frameworks that require a custom server
135
- */
136
- createDevServer: CreateDevServer;
137
- startDevServer: StartDevServer;
138
- build: Build;
139
132
  initConfigs: () => Promise<B extends 'rspack' ? Rspack.Configuration[] : WebpackConfig[]>;
140
133
  inspectConfig: (options?: InspectConfigOptions) => Promise<InspectConfigResult<B>>;
141
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
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.3.1",
49
+ "@rspack/core": "1.3.2",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.15",
52
52
  "core-js": "~3.41.0",
@@ -56,7 +56,7 @@
56
56
  "@rslib/core": "0.6.1",
57
57
  "@types/connect": "3.4.38",
58
58
  "@types/cors": "^2.8.17",
59
- "@types/node": "^22.13.16",
59
+ "@types/node": "^22.14.0",
60
60
  "@types/on-finished": "2.3.4",
61
61
  "@types/webpack-bundle-analyzer": "4.7.0",
62
62
  "@types/ws": "^8.18.1",
@@ -71,7 +71,7 @@
71
71
  "dotenv": "16.4.7",
72
72
  "dotenv-expand": "12.0.1",
73
73
  "html-rspack-plugin": "6.0.4",
74
- "http-proxy-middleware": "^2.0.6",
74
+ "http-proxy-middleware": "^2.0.7",
75
75
  "launch-editor-middleware": "^2.10.0",
76
76
  "mrmime": "^2.0.1",
77
77
  "on-finished": "2.4.1",