@rsbuild/core 2.2.14 → 2.3.0-beta.0

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,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 240: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 176: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(53);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(301);
6
6
  const compilerMap = new WeakMap();
7
7
  class CachedChildCompilation {
8
8
  constructor(compiler) {
@@ -307,7 +307,7 @@
307
307
  }
308
308
  module.exports = { CachedChildCompilation };
309
309
  },
310
- 53: (module) => {
310
+ 301: (module) => {
311
311
  "use strict";
312
312
  class HtmlWebpackChildCompiler {
313
313
  compilationPromise;
@@ -476,7 +476,7 @@
476
476
  }
477
477
  module.exports = { HtmlWebpackChildCompiler };
478
478
  },
479
- 251: (module) => {
479
+ 435: (module) => {
480
480
  "use strict";
481
481
  function none(chunks) {
482
482
  return chunks;
@@ -492,7 +492,7 @@
492
492
  }
493
493
  module.exports = { auto: none, manual, none };
494
494
  },
495
- 438: (module) => {
495
+ 934: (module) => {
496
496
  "use strict";
497
497
  module.exports = function (err) {
498
498
  return {
@@ -516,7 +516,7 @@
516
516
  };
517
517
  };
518
518
  },
519
- 861: (module, __unused_webpack_exports, __nccwpck_require__) => {
519
+ 677: (module, __unused_webpack_exports, __nccwpck_require__) => {
520
520
  "use strict";
521
521
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(537);
522
522
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -542,7 +542,7 @@
542
542
  }
543
543
  module.exports = { getHtmlRspackPluginHooks };
544
544
  },
545
- 748: (module) => {
545
+ 676: (module) => {
546
546
  const voidTags = [
547
547
  "area",
548
548
  "base",
@@ -610,19 +610,19 @@
610
610
  htmlTagObjectToString,
611
611
  };
612
612
  },
613
- 993: (module, __unused_webpack_exports, __nccwpck_require__) => {
613
+ 601: (module, __unused_webpack_exports, __nccwpck_require__) => {
614
614
  "use strict";
615
615
  const promisify = __nccwpck_require__(23).promisify;
616
616
  const vm = __nccwpck_require__(154);
617
617
  const fs = __nccwpck_require__(896);
618
618
  const path = __nccwpck_require__(928);
619
- const { CachedChildCompilation } = __nccwpck_require__(240);
619
+ const { CachedChildCompilation } = __nccwpck_require__(176);
620
620
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
621
- __nccwpck_require__(748);
622
- const prettyError = __nccwpck_require__(438);
623
- const chunkSorter = __nccwpck_require__(251);
621
+ __nccwpck_require__(676);
622
+ const prettyError = __nccwpck_require__(934);
623
+ const chunkSorter = __nccwpck_require__(435);
624
624
  const getHtmlRspackPluginHooks =
625
- __nccwpck_require__(861).getHtmlRspackPluginHooks;
625
+ __nccwpck_require__(677).getHtmlRspackPluginHooks;
626
626
  const WITH_PLACEHOLDER = "function __with_placeholder__";
627
627
  class HtmlRspackPlugin {
628
628
  constructor(userOptions = {}) {
@@ -2445,6 +2445,6 @@
2445
2445
  }
2446
2446
  if (typeof __nccwpck_require__ !== "undefined")
2447
2447
  __nccwpck_require__.ab = __dirname + "/";
2448
- var __webpack_exports__ = __nccwpck_require__(993);
2448
+ var __webpack_exports__ = __nccwpck_require__(601);
2449
2449
  module.exports = __webpack_exports__;
2450
2450
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 386: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(960)["default"];
4
+ 821: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(463)["default"];
6
6
  },
7
- 960: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 463: (__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 _nodePath = _interopRequireDefault(__nccwpck_require__(760));
12
- var _utils = __nccwpck_require__(329);
12
+ var _utils = __nccwpck_require__(234);
13
13
  function _interopRequireDefault(e) {
14
14
  return e && e.__esModule ? e : { default: e };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 329: (module, exports, __nccwpck_require__) => {
182
+ 234: (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__(386);
719
+ var __webpack_exports__ = __nccwpck_require__(821);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -1,4 +1,8 @@
1
1
  import { logger } from "./f~0.js";
2
+ function resolveLocation(location1) {
3
+ if ("u" > typeof URL && 'blob:' === location1.protocol && location1.origin && 'null' !== location1.origin) return new URL(location1.origin);
4
+ return location1;
5
+ }
2
6
  let createOverlay;
3
7
  let clearOverlay;
4
8
  const getErrorField = (error, field)=>{
@@ -44,7 +48,7 @@ function hmr_init(token, config, serverHost, serverPort, serverBase, liveReload,
44
48
  let hasBuildErrors = false;
45
49
  const base = serverBase.endsWith('/') ? serverBase : `${serverBase}/`;
46
50
  function formatURL(fallback) {
47
- const { location: location1 } = self;
51
+ const location1 = resolveLocation(self.location);
48
52
  const hostname = (fallback ? serverHost : config.host) || location1.hostname;
49
53
  const port = (fallback ? serverPort : config.port) || location1.port;
50
54
  const protocol = config.protocol || ('https:' === location1.protocol ? 'wss' : 'ws');
package/dist/hooks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AsyncHook, EnvironmentAsyncHook, InternalContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnExitFn, OnRestartFn, Rspack } from './types/index.js';
1
+ import type { AsyncHook, EnvironmentAsyncHook, InternalContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnClosePreviewServerFn, OnExitFn, OnRestartFn, Rspack } from './types/index.js';
2
2
  export declare function createEnvironmentAsyncHook<Callback extends (...args: any[]) => any>(): EnvironmentAsyncHook<Callback>;
3
3
  export declare function createAsyncHook<Callback extends (...args: any[]) => any>(): AsyncHook<Callback>;
4
4
  export declare function initHooks(): {
@@ -10,6 +10,7 @@ export declare function initHooks(): {
10
10
  onBeforeDevCompile: AsyncHook<OnBeforeDevCompileFn>;
11
11
  onAfterDevCompile: AsyncHook<OnAfterDevCompileFn>;
12
12
  onCloseDevServer: AsyncHook<OnCloseDevServerFn>;
13
+ onClosePreviewServer: AsyncHook<OnClosePreviewServerFn>;
13
14
  onAfterStartDevServer: AsyncHook<OnAfterStartDevServerFn>;
14
15
  onBeforeStartDevServer: AsyncHook<OnBeforeStartDevServerFn>;
15
16
  onAfterStartPreviewServer: AsyncHook<OnAfterStartPreviewServerFn>;
package/dist/index.d.ts CHANGED
@@ -25,4 +25,4 @@ export type { HotClient, HotOnConnect, RsbuildDevServer } from './server/devServ
25
25
  export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult } from './server/helper.js';
26
26
  export type { RsbuildPreviewServer } from './server/previewServer.js';
27
27
  // Types
28
- export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OnRestartFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, ReadonlyRoutes, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RestartContext, RestartFn, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMiddlewares, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildServerResponse, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFileEvent, WatchFiles, WebSocketUrlResolver } from './types/index.js';
28
+ export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnClosePreviewServerFn, OnDevCompileDoneFn, OnExitFn, OnRestartFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, ReadonlyRoutes, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RestartContext, RestartFn, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMiddlewares, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildServerResponse, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFileEvent, WatchFiles, WebSocketUrlResolver } from './types/index.js';
package/dist/m.js CHANGED
@@ -13,6 +13,7 @@ import { isPromise, isRegExp } from "node:util/types";
13
13
  import { readFile } from "node:fs/promises";
14
14
  import node_zlib, { constants as external_node_zlib_constants } from "node:zlib";
15
15
  import { once as external_node_events_once } from "node:events";
16
+ import { finished } from "node:stream";
16
17
  import { isIP } from "node:net";
17
18
  import { ALL_INTERFACES_IPV4, IMAGE_EXTENSIONS, ASSETS_DIST_DIR, FONT_DIST_DIR, AUDIO_EXTENSIONS, ensureAbsolutePath, NODE_MODULES_REGEX, FONT_EXTENSIONS, HMR_SOCKET_PATH, WASM_DIST_DIR, VIDEO_EXTENSIONS, BROWSER_LOG_PREFIX, toPosixPath, TRACK_EXTENSIONS, IMAGE_DIST_DIR, RSBUILD_OUTPUTS_PATH, DEFAULT_STACK_TRACE, LOADER_PATH, ASSET_EXTENSIONS, SVG_DIST_DIR, isWindows, COMPILED_PATH, WORKER_QUERY_REGEX, TS_CONFIG_FILE, dedupeNestedPaths, CSS_REGEX, relativeWithin, LAZY_COMPILATION_IDENTIFIER, DEFAULT_BROWSERSLIST, JS_REGEX, MEDIA_DIST_DIR, SCRIPT_REGEX, DEFAULT_WEB_BROWSERSLIST, getCompiledPath, normalizeRuleConditionPath, getPathnameFromUrl, toRelativePath, isDeno, CSS_DIST_DIR, INLINE_QUERY_REGEX, STATIC_PATH, RAW_QUERY_REGEX, PLUGIN_SWC_NAME, CLIENT_PATH, getCommonParentPath, LOCALHOST, JS_DIST_DIR, URL_QUERY_REGEX } from "./1.js";
18
19
  import { cachedImport as cachedImport_cachedImport, getTinyglobby } from "./r.js";
@@ -121,39 +122,6 @@ moduleFactories.add({
121
122
  }
122
123
  module.exports.f = expand;
123
124
  },
124
- "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ee-first/1.1.1/7d7aff2abffb03f454b885edc2f03bd078376c8cde75af0c324753fee26268de/node_modules/ee-first/index.js" (module) {
125
- function listener(event, done) {
126
- return function onevent(arg1) {
127
- for(var args = Array(arguments.length), i = 0; i < args.length; i++)args[i] = arguments[i];
128
- done('error' === event ? arg1 : null, this, event, args);
129
- };
130
- }
131
- module.exports = function first(stuff, done) {
132
- if (!Array.isArray(stuff)) throw TypeError('arg must be an array of [ee, events...] arrays');
133
- for(var cleanups = [], i = 0; i < stuff.length; i++){
134
- var arr = stuff[i];
135
- if (!Array.isArray(arr) || arr.length < 2) throw TypeError('each array member must be [ee, events...]');
136
- for(var ee = arr[0], j = 1; j < arr.length; j++){
137
- var event = arr[j], fn = listener(event, callback);
138
- ee.on(event, fn), cleanups.push({
139
- ee: ee,
140
- event: event,
141
- fn: fn
142
- });
143
- }
144
- }
145
- function callback() {
146
- cleanup(), done.apply(null, arguments);
147
- }
148
- function cleanup() {
149
- for(var x, i = 0; i < cleanups.length; i++)(x = cleanups[i]).ee.removeListener(x.event, x.fn);
150
- }
151
- function thunk(fn) {
152
- done = fn;
153
- }
154
- return thunk.cancel = cleanup, thunk;
155
- };
156
- },
157
125
  "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/lilconfig/3.1.3/8e9a79516bf61f8427342cef50cdad2cdc2572f42288ba8053b88eadfdc0ebef/node_modules/lilconfig/src/index.js" (module) {
158
126
  let path = __rspack_createRequire_require("path"), fs = __rspack_createRequire_require("fs"), os = __rspack_createRequire_require("os"), url = __rspack_createRequire_require("url"), fsReadFileAsync = fs.promises.readFile;
159
127
  function getDefaultSearchPlaces(name, sync) {
@@ -324,72 +292,6 @@ moduleFactories.add({
324
292
  };
325
293
  };
326
294
  },
327
- "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/on-finished/2.4.1/cf4b90e733493a0ce70ba421a5b37153ad39360f9513e36b25d2e49f57047a9b/node_modules/on-finished/index.js" (module) {
328
- module.exports = onFinished, module.exports.isFinished = isFinished;
329
- var asyncHooks = tryRequireAsyncHooks(), first = rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ee-first/1.1.1/7d7aff2abffb03f454b885edc2f03bd078376c8cde75af0c324753fee26268de/node_modules/ee-first/index.js"), defer = 'function' == typeof setImmediate ? setImmediate : function(fn) {
330
- process.nextTick(fn.bind.apply(fn, arguments));
331
- };
332
- function onFinished(msg, listener) {
333
- return !1 !== isFinished(msg) ? defer(listener, null, msg) : attachListener(msg, wrap(listener)), msg;
334
- }
335
- function isFinished(msg) {
336
- var socket = msg.socket;
337
- return 'boolean' == typeof msg.finished ? !!(msg.finished || socket && !socket.writable) : 'boolean' == typeof msg.complete ? !!(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable) : void 0;
338
- }
339
- function attachFinishedListener(msg, callback) {
340
- var eeMsg, eeSocket, finished = !1;
341
- function onFinish(error) {
342
- eeMsg.cancel(), eeSocket.cancel(), finished = !0, callback(error);
343
- }
344
- function onSocket(socket) {
345
- msg.removeListener('socket', onSocket), finished || eeMsg === eeSocket && (eeSocket = first([
346
- [
347
- socket,
348
- 'error',
349
- 'close'
350
- ]
351
- ], onFinish));
352
- }
353
- (eeMsg = eeSocket = first([
354
- [
355
- msg,
356
- 'end',
357
- 'finish'
358
- ]
359
- ], onFinish), msg.socket) ? onSocket(msg.socket) : (msg.on('socket', onSocket), void 0 === msg.socket && patchAssignSocket(msg, onSocket));
360
- }
361
- function attachListener(msg, listener) {
362
- var attached = msg.__onFinished;
363
- attached && attached.queue || (attached = msg.__onFinished = createListener(msg), attachFinishedListener(msg, attached)), attached.queue.push(listener);
364
- }
365
- function createListener(msg) {
366
- function listener(err) {
367
- if (msg.__onFinished === listener && (msg.__onFinished = null), listener.queue) {
368
- var queue = listener.queue;
369
- listener.queue = null;
370
- for(var i = 0; i < queue.length; i++)queue[i](err, msg);
371
- }
372
- }
373
- return listener.queue = [], listener;
374
- }
375
- function patchAssignSocket(res, callback) {
376
- var assignSocket = res.assignSocket;
377
- 'function' == typeof assignSocket && (res.assignSocket = function _assignSocket(socket) {
378
- assignSocket.call(this, socket), callback(socket);
379
- });
380
- }
381
- function tryRequireAsyncHooks() {
382
- try {
383
- return rspackRequire("async_hooks");
384
- } catch (e) {
385
- return {};
386
- }
387
- }
388
- function wrap(fn) {
389
- var res;
390
- return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
391
- }
392
- },
393
295
  "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/cbcc4ffbb08c543cea9a1ac750ccfc742d666712f0530b683d312c61ffd50060/node_modules/postcss-load-config/src/index.js" (module) {
394
296
  let yaml, { resolve } = __rspack_createRequire_require("node:path"), config = rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/lilconfig/3.1.3/8e9a79516bf61f8427342cef50cdad2cdc2572f42288ba8053b88eadfdc0ebef/node_modules/lilconfig/src/index.js"), loadOptions = rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/cbcc4ffbb08c543cea9a1ac750ccfc742d666712f0530b683d312c61ffd50060/node_modules/postcss-load-config/src/options.js"), loadPlugins = rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/cbcc4ffbb08c543cea9a1ac750ccfc742d666712f0530b683d312c61ffd50060/node_modules/postcss-load-config/src/plugins.js"), req = rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/cbcc4ffbb08c543cea9a1ac750ccfc742d666712f0530b683d312c61ffd50060/node_modules/postcss-load-config/src/req.js");
395
297
  async function processResult(ctx, result) {
@@ -531,9 +433,6 @@ moduleFactories.add({
531
433
  throw Error(`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.map((error)=>error.message).join('\n')}`);
532
434
  };
533
435
  },
534
- async_hooks (module) {
535
- module.exports = __rspack_createRequire_require("async_hooks");
536
- },
537
436
  process (module) {
538
437
  module.exports = __rspack_createRequire_require("process");
539
438
  },
@@ -2429,6 +2328,7 @@ function initHooks() {
2429
2328
  onBeforeDevCompile: createAsyncHook(),
2430
2329
  onAfterDevCompile: createAsyncHook(),
2431
2330
  onCloseDevServer: createAsyncHook(),
2331
+ onClosePreviewServer: createAsyncHook(),
2432
2332
  onAfterStartDevServer: createAsyncHook(),
2433
2333
  onBeforeStartDevServer: createAsyncHook(),
2434
2334
  onAfterStartPreviewServer: createAsyncHook(),
@@ -3185,6 +3085,7 @@ function initPluginAPI({ context, pluginManager }) {
3185
3085
  onCloseBuild: hooks.onCloseBuild.tap,
3186
3086
  onBeforeBuild: hooks.onBeforeBuild.tap,
3187
3087
  onCloseDevServer: hooks.onCloseDevServer.tap,
3088
+ onClosePreviewServer: hooks.onClosePreviewServer.tap,
3188
3089
  onBeforeDevCompile: hooks.onBeforeDevCompile.tap,
3189
3090
  onAfterDevCompile: hooks.onAfterDevCompile.tap,
3190
3091
  onDevCompileDone: hooks.onAfterDevCompile.tap,
@@ -3313,7 +3214,7 @@ function createPublicContext(context) {
3313
3214
  async function createContext(options, userConfig, logger, loadConfigResult) {
3314
3215
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, hooks = initHooks();
3315
3216
  return {
3316
- version: "2.2.14",
3217
+ version: "2.3.0-beta.0",
3317
3218
  rootPath,
3318
3219
  configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
3319
3220
  configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
@@ -5275,7 +5176,7 @@ let calcFileSize = (len)=>{
5275
5176
  return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
5276
5177
  }, COMPRESSIBLE_REGEX = /\.(?:js|mjs|cjs|jsx|ts|tsx|mts|cts|css|html|json|svg|txt|xml|xhtml|wasm|manifest|md)$/i;
5277
5178
  async function getFileSizes(options, compilation, processAssets) {
5278
- if (!1 === options.detail && !1 === options.total) return [];
5179
+ if ((!1 === options.detail || 0 === options.detail) && !1 === options.total) return [];
5279
5180
  let { exclude, include } = options, compression = getCompression(options.compressed), fileSizes = [], compilationAssets = compilation.assets, names = Object.getOwnPropertyNames(compilationAssets);
5280
5181
  return await processAssets(names, async (assetName, index)=>{
5281
5182
  let queryIndex, filePath = -1 === (queryIndex = assetName.indexOf('?')) ? assetName : assetName.slice(0, queryIndex);
@@ -5297,7 +5198,7 @@ async function getFileSizes(options, compilation, processAssets) {
5297
5198
  }), fileSizes.filter(Boolean);
5298
5199
  }
5299
5200
  function printFileSizes(options, fileSizes, rootPath, distPath, environmentName, previousSizes, saveSnapshot) {
5300
- let logs = [], compression = getCompression(options.compressed), prev = previousSizes?.[environmentName], showDetail = !1 !== options.detail, showDiff = !1 !== options.diff && null !== previousSizes, prevType = prev?.compressionType ?? (!!prev?.totalGzipSize && 'gzip'), showCompressedDiff = showDiff && prevType === compression.type, showTotal = !1 !== options.total;
5201
+ let logs = [], compression = getCompression(options.compressed), prev = previousSizes?.[environmentName], detailLimit = 'number' == typeof options.detail ? Math.max(0, Math.floor(options.detail)) : 1 / 0, showDetail = !1 !== options.detail && detailLimit > 0, showDiff = !1 !== options.diff && null !== previousSizes, prevType = prev?.compressionType ?? (!!prev?.totalGzipSize && 'gzip'), showCompressedDiff = showDiff && prevType === compression.type, showTotal = !1 !== options.total;
5301
5202
  if (!showTotal && !showDetail) return {
5302
5203
  logs
5303
5204
  };
@@ -5393,16 +5294,17 @@ function printFileSizes(options, fileSizes, rootPath, distPath, environmentName,
5393
5294
  totalBrotliSize: options.compressed && 'brotli' === compression.type ? totalCompressedSize : void 0
5394
5295
  }) : null;
5395
5296
  if (showDetail) {
5396
- let maxFileLength = Math.max(showTotal ? totalSizeTitle.length : 0, fileHeader.length), maxSizeLength = totalSizeLabelLength, hasCompressedSize = !1;
5397
- for (let asset of assets)asset.filenameLength > maxFileLength && (maxFileLength = asset.filenameLength), asset.sizeLabelLength > maxSizeLength && (maxSizeLength = asset.sizeLabelLength), null !== asset.compressedSize && (hasCompressedSize = !0);
5398
- let showCompressedHeader = !!(options.compressed && hasCompressedSize);
5399
- for (let asset of (logs.push(getHeader(maxFileLength, maxSizeLength, fileHeader, showCompressedHeader && compression.header)), assets)){
5297
+ let displayedAssets = assets.slice(Math.max(0, assets.length - detailLimit)), maxFileLength = Math.max(showTotal ? totalSizeTitle.length : 0, fileHeader.length), maxSizeLength = totalSizeLabelLength;
5298
+ for (let asset of displayedAssets)asset.filenameLength > maxFileLength && (maxFileLength = asset.filenameLength), asset.sizeLabelLength > maxSizeLength && (maxSizeLength = asset.sizeLabelLength);
5299
+ let showCompressedHeader = !!(options.compressed && (showTotal ? assets : displayedAssets).some((asset)=>null !== asset.compressedSize));
5300
+ for (let asset of (logs.push(getHeader(maxFileLength, maxSizeLength, fileHeader, showCompressedHeader && compression.header)), displayedAssets)){
5400
5301
  let { sizeLabel, filenameLabel } = asset, { sizeLabelLength, compressedSizeLabel, filenameLength } = asset;
5401
5302
  sizeLabelLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLabelLength)), filenameLength < maxFileLength && (filenameLabel += ' '.repeat(maxFileLength - filenameLength));
5402
5303
  let log = `${filenameLabel} ${sizeLabel}`;
5403
5304
  compressedSizeLabel && (log += ` ${compressedSizeLabel}`), logs.push(log);
5404
5305
  }
5405
- if (showTotal) {
5306
+ let hiddenCount = assets.length - displayedAssets.length;
5307
+ if (hiddenCount > 0 && logs.push(color.dim(`... ${hiddenCount} more ${1 === hiddenCount ? 'file' : 'files'} not shown`)), showTotal) {
5406
5308
  logs.push('');
5407
5309
  let customTotal = getCustomTotal();
5408
5310
  if (customTotal) logs.push(customTotal);
@@ -6091,7 +5993,7 @@ function doesChunkBelongToHtml({ chunk, htmlPluginData }) {
6091
5993
  let { options } = htmlPluginData.plugin;
6092
5994
  return recursiveChunkEntryNames(chunk).some((chunkName)=>isChunksFiltered(chunkName, options?.chunks, options?.excludeChunks));
6093
5995
  }
6094
- let getManifestPlugin = cachedImport_cachedImport(()=>import("./manifest-plugin.js").then(rspackRequire.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/index.js"))), isCSSPath = (filePath)=>filePath.endsWith('.css');
5996
+ let getManifestPlugin = cachedImport_cachedImport(()=>import("./manifest-plugin.js").then(rspackRequire.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/index.js"))), isCSSPath = (filePath)=>filePath.endsWith('.css');
6095
5997
  function normalizeManifestObjectConfig(manifest) {
6096
5998
  let defaultOptions = {
6097
5999
  prefix: !0,
@@ -6669,7 +6571,6 @@ function parseTokenList(str) {
6669
6571
  }
6670
6572
  return start !== end && list.push(str.substring(start, end)), list;
6671
6573
  }
6672
- var on_finished_default = compatGetDefaultExport(rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/on-finished/2.4.1/cf4b90e733493a0ce70ba421a5b37153ad39360f9513e36b25d2e49f57047a9b/node_modules/on-finished/index.js"));
6673
6574
  function getEtag(stat) {
6674
6575
  let mtime = stat.mtime.getTime().toString(16), size = stat.size.toString(16);
6675
6576
  return `W/"${size}-${mtime}"`;
@@ -6885,7 +6786,7 @@ function createAssetsMiddleware(context, ready, outputFileSystem) {
6885
6786
  default:
6886
6787
  sendError(res, 500);
6887
6788
  }
6888
- }), readStream.pipe(res), on_finished_default()(res, cleanup);
6789
+ }), readStream.pipe(res), finished(res, cleanup);
6889
6790
  });
6890
6791
  };
6891
6792
  }
@@ -7694,7 +7595,7 @@ let faviconFallbackMiddleware = (req, res, next)=>{
7694
7595
  '/favicon.ico' === req.url ? (res.statusCode = 204, res.end()) : next();
7695
7596
  }, getRequestLoggerMiddleware = (logger)=>(req, res, next)=>{
7696
7597
  let _startAt = process.hrtime();
7697
- on_finished_default()(res, ()=>{
7598
+ finished(res, ()=>{
7698
7599
  let method = req.method, url = req.originalUrl || req.url, status = Number(res.statusCode), statusColor = status >= 500 ? color.red : status >= 400 ? color.yellow : status >= 300 ? color.cyan : status >= 200 ? color.green : (res)=>res, endAt = process.hrtime(), totalTime = (endAt[0] - _startAt[0]) * 1e3 + (endAt[1] - _startAt[1]) * 1e-6;
7699
7600
  logger.debug(`${statusColor(status)} ${method} ${url} ${color.dim(`${totalTime.toFixed(3)} ms`)}`);
7700
7601
  }), next();
@@ -8577,7 +8478,7 @@ async function startPreviewServer(context, config, { getPortSilently } = {}) {
8577
8478
  serverConfig,
8578
8479
  middlewares
8579
8480
  }), cleanupGracefulShutdown = setupGracefulShutdown(), serverTerminator = getServerTerminator(httpServer), closingPromise = null, closeServer = async ()=>(closingPromise || (closingPromise = (async ()=>{
8580
- removeCleanup(closeServer), cleanupGracefulShutdown(), cleanupCliShortcuts?.(), await serverTerminator();
8481
+ removeCleanup(closeServer), cleanupGracefulShutdown(), cleanupCliShortcuts?.(), await serverTerminator(), await context.hooks.onClosePreviewServer.callBatch();
8581
8482
  })()), closingPromise), printUrls = (options)=>printServerURLs({
8582
8483
  urls,
8583
8484
  port,
@@ -10167,6 +10068,7 @@ async function createRsbuild(options = {}) {
10167
10068
  'onBeforeStartPreviewServer',
10168
10069
  'onCloseBuild',
10169
10070
  'onCloseDevServer',
10071
+ 'onClosePreviewServer',
10170
10072
  'onDevCompileDone',
10171
10073
  'onExit',
10172
10074
  'onRestart'
@@ -10391,7 +10293,7 @@ let applyServerOptions = (command)=>{
10391
10293
  };
10392
10294
  function setupCommands(argv) {
10393
10295
  let cli = ((name = "")=>new CAC(name))('rsbuild');
10394
- cli.version("2.2.14"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
10296
+ cli.version("2.3.0-beta.0"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
10395
10297
  default: 'auto'
10396
10298
  }).option('--dist-path <dir>', 'Set the root directory of output files').option('--source-map', 'Enable source map').option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
10397
10299
  type: [
@@ -10456,7 +10358,7 @@ function setupCommands(argv) {
10456
10358
  }
10457
10359
  function showGreeting() {
10458
10360
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
10459
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.14\n`);
10361
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.3.0-beta.0\n`);
10460
10362
  }
10461
10363
  function setupLogLevel(argv) {
10462
10364
  if (argv.length <= 3) return;
@@ -10478,5 +10380,5 @@ function runCLI({ argv = process.argv } = {}) {
10478
10380
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
10479
10381
  }
10480
10382
  }
10481
- let src_version = "2.2.14";
10383
+ let src_version = "2.3.0-beta.0";
10482
10384
  export { core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger_createLogger as createLogger, mergeRsbuildConfig, mrmime_lookup, runCLI, src_logger as logger, src_version as version };
@@ -1,16 +1,3 @@
1
- /*!
2
- * ee-first
3
- * Copyright(c) 2014 Jonathan Ong
4
- * MIT Licensed
5
- */
6
-
7
- /*!
8
- * on-finished
9
- * Copyright(c) 2013 Jonathan Ong
10
- * Copyright(c) 2014 Douglas Christopher Wilson
11
- * MIT Licensed
12
- */
13
-
14
1
  /**
15
2
  * Autoload Config for PostCSS
16
3
  *
@@ -1 +1 @@
1
- import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as s}from"node:module";let r=s(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let s=r("node:path");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,r)=>{let n;return(r[t.name]?n=r[t.name]:t.info.sourceFilename&&(n=(0,s.join)((0,s.dirname)(t.name),(0,s.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,r,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,s.basename)(e),path:e}}),Array.from(t.files).reduce((e,s)=>{let n=t.name?t.name:null;return n=n?r.useEntryKeys&&!s.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(s,r)}`:s,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:s})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/hooks.js"(t,s){s.getCompilerHooks=s.emitHook=s.beforeRunHook=void 0;let n=r("node:fs"),o=r("node:path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,p=e=>{let t=l.get(e);return void 0===t&&(t={afterEmit:new a.SyncWaterfallHook(["manifest"]),beforeEmit:new a.SyncWaterfallHook(["manifest"])},l.set(e,t)),t};s.getCompilerHooks=p,s.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},s.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:r,moduleAssets:a,options:l},c){let h=t.get(r)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==l.publicPath?l.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:d,removeKeyHash:m}=l;t.set(r,h);let k={},y=Array.from(c.chunks).reduce((e,t)=>(0,i.reduceChunk)(e,t,l,k),[]);(y=(y=u.assets.reduce((e,t)=>(0,i.reduceAssets)(e,t,a),y)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,o.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete k[e.path]}),Object.keys(k).forEach(e=>{y=y.concat(k[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),y=y.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:d?t(d)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=m?s.name.replace(m,""):s.name,Object.assign(e,s)}),y=(0,i.transformFiles)(y,l);let _=(0,i.generateManifest)(c,y,l),b=0===h;if(_=p(e).beforeEmit.call(_),b){let t=l.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}p(e).afterEmit.call(_)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/index.js"(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.RspackManifestPlugin=s.WebpackManifestPlugin=s.getCompilerHooks=void 0;let n=r("node:path"),o=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/hooks.js");Object.defineProperty(s,"getCompilerHooks",{enumerable:!0,get:function(){return o.getCompilerHooks}});let a=new Map,i={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};class l{options;constructor(e){this.options=Object.assign({},i,e)}apply(e){let t=(0,n.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,n.relative)(e.options.output?.path||"./",t),r=o.beforeRunHook.bind(this,{emitCountMap:a,manifestFileName:t}),i=o.emitHook.bind(this,{compiler:e,emitCountMap:a,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,r),e.hooks.watchRun.tapAsync(l,r)}}s.WebpackManifestPlugin=l,s.RspackManifestPlugin=l},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_tapsInAllStages(){let e=this._allStageTaps;if(void 0!==e&&e.source===this.taps&&e.length===this.taps.length)return e.taps;let t=this.queryStageRange(a).tapsInRange;return this._allStageTaps={source:this.taps,length:this.taps.length,taps:t},t}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),n(this,"_allStageTaps",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[],this._allStageTaps=void 0}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++)t[e].fn(...s)}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);if(void 0!==r)return r}}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);void 0!==r&&(s[0]=r)}}catch(e){if(e)throw e;return}return s[0]}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)},p=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e?p(e):c===r.length?i():h()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(c=r.length,l(e)):(c+=1,void 0!==t?p(t):c===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,c=r.length,l(e)}s||(c+=1,void 0!==t?p(t):c===r.length?i():h())}if(c===r.length)return};h()}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let d=(e,t)=>t;class m{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:d},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new k(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class k{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class y{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new y(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var S in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>g,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>f,HookBase:()=>o,HookMap:()=>m,MultiHook:()=>y,QueriedHook:()=>i,QueriedHookMap:()=>k,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(S)&&(t[S]=r[S]);Object.defineProperty(t,"__esModule",{value:!0})}});let n=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/cbeeb1bf16831c5d12121244c2e0e825d7a61324a587214ca9e44e464c6b1496/node_modules/rspack-manifest-plugin/dist/index.js");var o=n.RspackManifestPlugin,a=n.WebpackManifestPlugin,i=n.__esModule,l=n.getCompilerHooks;export{o as RspackManifestPlugin,a as WebpackManifestPlugin,i as __esModule,l as getCompilerHooks};
1
+ import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as s}from"node:module";let r=s(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let s=r("node:path");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,r)=>{let n;return(r[t.name]?n=r[t.name]:t.info.sourceFilename&&(n=(0,s.join)((0,s.dirname)(t.name),(0,s.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,r,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,s.basename)(e),path:e}}),Array.from(t.files).reduce((e,s)=>{let n=t.name?t.name:null;return n=n?r.useEntryKeys&&!s.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(s,r)}`:s,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:s})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/hooks.js"(t,s){s.getCompilerHooks=s.emitHook=s.beforeRunHook=void 0;let n=r("node:fs"),o=r("node:path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,p=e=>{let t=l.get(e);return void 0===t&&(t={afterEmit:new a.SyncWaterfallHook(["manifest"]),beforeEmit:new a.SyncWaterfallHook(["manifest"])},l.set(e,t)),t};s.getCompilerHooks=p,s.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},s.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:r,moduleAssets:a,options:l},c){let h=t.get(r)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==l.publicPath?l.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:d,removeKeyHash:m}=l;t.set(r,h);let k={},y=Array.from(c.chunks).reduce((e,t)=>(0,i.reduceChunk)(e,t,l,k),[]);(y=(y=u.assets.reduce((e,t)=>(0,i.reduceAssets)(e,t,a),y)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,o.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete k[e.path]}),Object.keys(k).forEach(e=>{y=y.concat(k[e])});let b={};u.assets?.forEach(e=>{e.integrity&&(b[e.name]=e.integrity)}),y=y.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:d?t(d)+e.name:e.name,path:f?t(f)+e.path:e.path};return b[e.path]&&(s.integrity=b[e.path]),s.name=m?s.name.replace(m,""):s.name,Object.assign(e,s)}),y=(0,i.transformFiles)(y,l);let S=(0,i.generateManifest)(c,y,l),_=0===h;if(S=p(e).beforeEmit.call(S),_){let t=l.serialize(S);c.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}p(e).afterEmit.call(S)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/index.js"(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.RspackManifestPlugin=s.WebpackManifestPlugin=s.getCompilerHooks=void 0;let n=r("node:path"),o=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/hooks.js");Object.defineProperty(s,"getCompilerHooks",{enumerable:!0,get:function(){return o.getCompilerHooks}});let a=new Map,i={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};class l{options;constructor(e){this.options=Object.assign({},i,e)}apply(e){let t=(0,n.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,n.relative)(e.options.output?.path||"./",t),r=o.beforeRunHook.bind(this,{emitCountMap:a,manifestFileName:t}),i=o.emitHook.bind(this,{compiler:e,emitCountMap:a,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,r),e.hooks.watchRun.tapAsync(l,r)}}s.WebpackManifestPlugin=l,s.RspackManifestPlugin=l},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_tapsInAllStages(){let e=this._allStageTaps;if(void 0!==e&&e.source===this.taps&&e.length===this.taps.length)return e.taps;let t=this.queryStageRange(a).tapsInRange;return this._allStageTaps={source:this.taps,length:this.taps.length,taps:t},t}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),n(this,"_allStageTaps",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[],this._allStageTaps=void 0}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++)t[e].fn(...s)}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);if(void 0!==r)return r}}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);void 0!==r&&(s[0]=r)}}catch(e){if(e)throw e;return}return s[0]}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)},p=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e?p(e):c===r.length?i():h()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(c=r.length,l(e)):(c+=1,void 0!==t?p(t):c===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,c=r.length,l(e)}s||(c+=1,void 0!==t?p(t):c===r.length?i():h())}if(c===r.length)return};h()}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let d=(e,t)=>t;class m{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:d},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new k(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class k{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class y{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new y(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var b in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>g,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>f,HookBase:()=>o,HookMap:()=>m,MultiHook:()=>y,QueriedHook:()=>i,QueriedHookMap:()=>k,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(b)&&(t[b]=r[b]);Object.defineProperty(t,"__esModule",{value:!0})}});let n=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/5e5a5791f2423171b25b8669ed999592c8e86d6947ab7c911dfb27037dbbb5ae/node_modules/rspack-manifest-plugin/dist/index.js");var o=n.RspackManifestPlugin,a=n.WebpackManifestPlugin,i=n.__esModule,l=n.getCompilerHooks;export{o as RspackManifestPlugin,a as WebpackManifestPlugin,i as __esModule,l as getCompilerHooks};
@@ -92,7 +92,8 @@ export declare const HttpCode: {
92
92
  */ export type RsbuildServerBase = {
93
93
  /**
94
94
  * Close the server.
95
- * In the dev server, this will call the `onCloseDevServer` hook.
95
+ * Calls the `onCloseDevServer` or `onClosePreviewServer` hook and waits for
96
+ * async cleanup callbacks to complete.
96
97
  */ close: () => Promise<void>;
97
98
  /**
98
99
  * The Node.js HTTP server instance.
@@ -507,9 +507,12 @@ export type PrintFileSizeOptions = {
507
507
  totalBrotliSize?: number;
508
508
  }) => string);
509
509
  /**
510
- * Whether to print the size of each static asset.
510
+ * Controls how many asset sizes to print in each environment.
511
+ * Set to `true` to print all assets, or `false` or `0` to hide individual assets.
512
+ * A positive integer limits the list to the largest assets by uncompressed size.
513
+ * Omitted assets still contribute to totals and size comparisons when `diff` is enabled.
511
514
  * @default true
512
- */ detail?: boolean;
515
+ */ detail?: boolean | number;
513
516
  /**
514
517
  * Whether to print the compressed size of each static asset.
515
518
  * Set to `true` to use gzip, or specify `type` to select gzip or Brotli.
@@ -43,6 +43,7 @@ export type OnAfterBuildFn = (params: CompileCommonParams & {
43
43
  */ environments: Record<string, EnvironmentContext>;
44
44
  }) => MaybePromise<void>;
45
45
  export type OnCloseDevServerFn = () => MaybePromise<void>;
46
+ export type OnClosePreviewServerFn = () => MaybePromise<void>;
46
47
  export type OnAfterDevCompileFn = (params: {
47
48
  isFirstCompile: boolean;
48
49
  stats: Rspack.Stats | Rspack.MultiStats;