@rsbuild/core 2.2.10 → 2.2.11

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
- 535: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 793: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(284);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(82);
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
- 284: (module) => {
310
+ 82: (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
- 876: (module) => {
479
+ 474: (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
- 123: (module) => {
495
+ 621: (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
- 90: (module, __unused_webpack_exports, __nccwpck_require__) => {
519
+ 116: (module, __unused_webpack_exports, __nccwpck_require__) => {
520
520
  "use strict";
521
521
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(176);
522
522
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -542,7 +542,7 @@
542
542
  }
543
543
  module.exports = { getHtmlRspackPluginHooks };
544
544
  },
545
- 527: (module) => {
545
+ 265: (module) => {
546
546
  const voidTags = [
547
547
  "area",
548
548
  "base",
@@ -610,19 +610,19 @@
610
610
  htmlTagObjectToString,
611
611
  };
612
612
  },
613
- 718: (module, __unused_webpack_exports, __nccwpck_require__) => {
613
+ 52: (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__(535);
619
+ const { CachedChildCompilation } = __nccwpck_require__(793);
620
620
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
621
- __nccwpck_require__(527);
622
- const prettyError = __nccwpck_require__(123);
623
- const chunkSorter = __nccwpck_require__(876);
621
+ __nccwpck_require__(265);
622
+ const prettyError = __nccwpck_require__(621);
623
+ const chunkSorter = __nccwpck_require__(474);
624
624
  const getHtmlRspackPluginHooks =
625
- __nccwpck_require__(90).getHtmlRspackPluginHooks;
625
+ __nccwpck_require__(116).getHtmlRspackPluginHooks;
626
626
  const WITH_PLACEHOLDER = "function __with_placeholder__";
627
627
  class HtmlRspackPlugin {
628
628
  constructor(userOptions = {}) {
@@ -2395,6 +2395,6 @@
2395
2395
  }
2396
2396
  if (typeof __nccwpck_require__ !== "undefined")
2397
2397
  __nccwpck_require__.ab = __dirname + "/";
2398
- var __webpack_exports__ = __nccwpck_require__(718);
2398
+ var __webpack_exports__ = __nccwpck_require__(52);
2399
2399
  module.exports = __webpack_exports__;
2400
2400
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 841: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(147)["default"];
4
+ 951: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(265)["default"];
6
6
  },
7
- 147: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 265: (__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__(870);
12
+ var _utils = __nccwpck_require__(284);
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
- 870: (module, exports, __nccwpck_require__) => {
182
+ 284: (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__(841);
719
+ var __webpack_exports__ = __nccwpck_require__(951);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -94,7 +94,9 @@ function hmr_init(token, config, serverHost, serverPort, serverBase, liveReload,
94
94
  }
95
95
  function handleResolvedClientError({ id, message }) {
96
96
  if (!createOverlay || hasBuildErrors) return;
97
- for (const item of clientErrors)if (item.id === id) item.message = message;
97
+ const clientError = clientErrors.find((item)=>item.id === id);
98
+ if (!clientError) return;
99
+ clientError.message = message;
98
100
  createOverlay('Runtime errors', clientErrors.map((item)=>item.message).filter(Boolean).join('\n\n'));
99
101
  }
100
102
  const shouldUpdate = ()=>lastHash !== import.meta.rspackHash;
@@ -145,7 +147,10 @@ function hmr_init(token, config, serverHost, serverPort, serverBase, liveReload,
145
147
  switch(message.type){
146
148
  case 'hash':
147
149
  lastHash = message.data;
148
- if (clearOverlay && shouldUpdate()) clearOverlay();
150
+ if (shouldUpdate()) {
151
+ clientErrors.length = 0;
152
+ null == clearOverlay || clearOverlay();
153
+ }
149
154
  break;
150
155
  case 'ok':
151
156
  handleSuccess();
@@ -13,6 +13,12 @@ function _define_property(obj, key, value) {
13
13
  const { HTMLElement: HTMLElement = class {
14
14
  }, customElements: customElements } = "u" > typeof window ? window : globalThis;
15
15
  class ErrorOverlay extends HTMLElement {
16
+ connectedCallback() {
17
+ document.addEventListener('keydown', this.onEscKeydown);
18
+ }
19
+ disconnectedCallback() {
20
+ document.removeEventListener('keydown', this.onEscKeydown);
21
+ }
16
22
  init(html) {
17
23
  var _root_querySelector, _root_querySelector1;
18
24
  const root = this.attachShadow({
@@ -28,14 +34,11 @@ class ErrorOverlay extends HTMLElement {
28
34
  }
29
35
  e.stopPropagation();
30
36
  });
31
- const onEscKeydown = (e)=>{
32
- if ('Escape' === e.key || 'Escape' === e.code) this.close();
33
- document.removeEventListener('keydown', onEscKeydown);
34
- };
35
- document.addEventListener('keydown', onEscKeydown);
36
37
  }
37
38
  constructor(...args){
38
- super(...args), _define_property(this, "close", (immediate = false)=>{
39
+ super(...args), _define_property(this, "onEscKeydown", (e)=>{
40
+ if ('Escape' === e.key || 'Escape' === e.code) this.close();
41
+ }), _define_property(this, "close", (immediate = false)=>{
39
42
  const remove = ()=>{
40
43
  var _this_parentNode;
41
44
  return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
@@ -5,6 +5,7 @@ export { require } from './vendors.js';
5
5
  export { color, RspackChain };
6
6
  export declare const getNodeEnv: () => string;
7
7
  export declare const setNodeEnv: (env: string) => void;
8
+ export declare const isCI: () => boolean;
8
9
  export declare const isFunction: (func: unknown) => func is (...args: any[]) => any;
9
10
  export declare const isObject: (obj: unknown) => obj is Record<string, any>;
10
11
  export declare const isPlainObject: (obj: unknown) => obj is Record<string, any>;
@@ -11,4 +11,4 @@ import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import r
11
11
  For more details, see: https://github.com/chimurai/http-proxy-middleware/issues/40
12
12
  `,H=(e,t)=>{e.on("error",(e,t,r,o)=>{$(`httpxy error event:
13
13
  %O`,e),"ECONNRESET"===e.code&&t&&"POST"===t.method&&"body"in t&&t.body&&console.error(i("red",O))}),e.on("proxyReq",(e,t,r)=>{r.on("error",e=>{$("Socket error in proxyReq event: \n%O",e)})}),e.on("proxyRes",(e,t,r)=>{r.on("close",()=>{r.writableEnded||($("Destroying proxyRes in proxyRes close event"),e.destroy())})}),e.on("proxyReqWs",(e,t,r)=>{r.on("error",e=>{$("Socket error in proxyReqWs event: \n%O",e)})}),e.on("open",e=>{e.on("error",e=>{$("Socket error in open event: \n%O",e)})}),e.on("close",(e,t,r)=>{t.on("error",e=>{$("Socket error in close event: \n%O",e)})}),e.on("econnreset",(e,t,r,o)=>{$(`httpxy econnreset event:
14
- %O`,e)})};function T(e){return e?.replace(/[<>]/g,e=>encodeURIComponent(e))??""}let L=(e,t)=>{e.on("error",(e,t,r,o)=>{if(!t||!r)throw e;if(r&&"function"==typeof r.writeHead){if(!r.headersSent){let t=function(e){let t;if(/HPE_INVALID/.test(e))return 502;if(/HPM_ERR_INVALID_MULTIPART_/.test(e))return 400;switch(e){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":t=504;break;default:t=500}return t}(e.code);r.writeHead(t)}let o=t.headers&&t.headers.host;r.end(`Error occurred while trying to proxy: ${T(o)}${T(t.url)}`)}else!r||"function"!=typeof r.write||"writeHead"in r||r.destroy()})},I={info:()=>{},warn:()=>{},error:()=>{}},F=(e,t)=>{let r=t.logger||I;e.on("error",(e,t,o,n)=>{let s=t?.headers?.host,i=`${s}${t?.url}`,a=`${n?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",i,a,e.code||e,"https://nodejs.org/api/errors.html#errors_common_system_errors")}),e.on("proxyRes",(e,o,n)=>{let s,i=o.originalUrl??`${o.baseUrl||""}${o.url}`;try{var c;let t=(c=e.req?.agent?.sockets,Object.keys(c||{})?.[0]?.split(":")[1]),{protocol:r,host:o,path:n}=e.req;s=function({protocol:e,host:t,port:r,path:o}){let n=t?.includes(":")?`[${t}]`:t,s=new u(`${e||"undefined:"}//${n||"[::]"}`);return r&&(s.port=r),o&&(s.pathname=o),s}({protocol:r,host:o,port:t,path:n})}catch(r){console.error("[HPM] Unexpected error while creating target URL",r),(s=new a(t.target)).pathname=e.req.path}let l=s.toString(),p=`[HPM] ${o.method} ${i} -> ${l} [${e.statusCode}]`;r.info(p)}),e.on("open",e=>{r.info("[HPM] Client connected: %o",e.address())}),e.on("close",(e,t,o)=>{r.info("[HPM] Client disconnected: %o",t.address())})};function P(e){return e.name||"[anonymous Function]"}let j=S.extend("proxy-events-plugin"),N=(e,t)=>{let r;if(t.on){for(r in t.on)if(Object.prototype.hasOwnProperty.call(t.on,r)){let o=t.on[r];if(!o)continue;j(`register event handler: "${r}" -> "${P(o)}"`),e.on(r,o)}}},M=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/is-glob/4.0.3/5f6010d19ebbd407d4ddad3f32ad93b07ae9baaa0b44d778899bd947e1a7324b/node_modules/is-glob/index.js"),U=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/micromatch/4.0.8/e3e5f26f16f8b95548bbbd14ad679e23348853c21837502922840101deaebdcd/node_modules/micromatch/index.js");function B(e,t){let r=G(t);return r?.indexOf(e)===0}function D(e,t){let r=U([G(t)],e);return r&&r.length>0}function G(e){return e&&new URL(e,"http://0.0.0.0").pathname}function q(e){return"string"==typeof e&&!M(e)}function K(e){return M(e)}function W(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let Z=S.extend("path-rewriter"),z=S.extend("router");async function Q(e,t,r){let o,n=r.router;return W(n)?o=function(e,t){let r,o=e.headers.host??"",n=e.url??"";for(let[e,i]of Object.entries(t))if(V(e)){var s;if(V(s=e)&&!s.startsWith("/")){let[t,s]=function(e){let t=e.indexOf("/");return[e.slice(0,t),e.slice(t)]}(e);if(o===t&&n.startsWith(s)){z('match: "%s" -> "%s"',e,r=i);break}}else if(n.startsWith(e)){z('match: "%s" -> "%s"',e,r=i);break}}else if(e===o){z('match: "%s" -> "%s"',o,r=i);break}return r}(e,n):"function"==typeof n&&(o=await n(e,t,r)),o}function V(e){return e.indexOf("/")>-1}let X=S.extend("ipv6");function Y(e,t){var r,o,n;let s="string"==typeof(r=e)?new URL(r):r instanceof URL?r:void 0;if(s&&(o=s.hostname).startsWith("[")&&o.endsWith("]")){let r="::"===(n=s.hostname.replace(/^\[|\]$/g,""))?(X("normalizing hostname unspecified IPv6 address (::) to loopback (::1)"),"::1"):n;return X('normalized IPv6 "%s" %s',t,e),{hostname:r,auth:s.username||s.password?`${s.username}:${s.password}`:void 0,pathname:s.pathname,port:s.port,protocol:s.protocol,search:s.search}}return e}class J{wsInternalSubscribedServers=new WeakSet;activeServers=new Set;proxyOptions;proxy;pathRewriter;logger;constructor(e){if(!e.target&&!e.router)throw new k('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',"ERR_CONFIG_FACTORY_TARGET_MISSING");this.proxyOptions=e,this.logger=e.logger||I,S("create proxy server"),this.proxy=function(e={}){return new w(e)}({}),this.registerPlugins(this.proxy,this.proxyOptions),this.pathRewriter=function(e){let t;if(function(e){if("function"==typeof e)return!0;if(W(e))return 0!==Object.keys(e).length;if(null==e)return!1;throw new k("[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function","HPM_INVALID_PATH_REWRITER_CONFIG")}(e))if("function"==typeof e)return e;else return t=function(e){let t=[];if(W(e))for(let[r,o]of Object.entries(e))t.push({regex:new RegExp(r),value:o}),Z('rewrite rule created: "%s" ~> "%s"',r,o);return t}(e),function(e){let r=e;for(let o of t)if(o.regex.test(e)){Z('rewriting path from "%s" to "%s"',e,r=r.replace(o.regex,o.value));break}return r}}(this.proxyOptions.pathRewrite),this.middleware.upgrade=(e,t,r)=>{let o=this.#e(e);o&&!this.wsInternalSubscribedServers.has(o)&&this.handleUpgrade(e,t,r)}}#e(e){return e.socket?.server}middleware=async(e,t,r)=>{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o;try{if(!(o=await this.prepareProxyRequest(e,t)).target&&!o.forward)throw Error("Must provide a proper URL as target")}catch(e){r?.(e);return}try{S("proxy request to target: %O",o.target),await this.proxy.web(e,t,o)}catch(n){this.proxy.emit("error",n,e,t,o.target),r?.(n)}}else r?.();let o=this.#e(e);o&&!this.activeServers.has(o)&&(S("registering server close listener"),this.activeServers.add(o),o.on("close",()=>{(S("server close signal received."),this.activeServers.delete(o),this.activeServers.size>0)?S(`proxy server not closed: ${this.activeServers.size} server(s) still active`):(S("closing proxy server"),this.proxy.close(()=>S("proxy server closed")))})),!0===this.proxyOptions.ws&&o&&this.catchUpgradeRequest(o)};registerPlugins(e,t){let r;(r=t.on?.error?[]:[L],[...t.ejectPlugins?[]:[H,N,F,...r],...t.plugins??[]]).forEach(r=>{S(`register plugin: "${P(r)}"`),r(e,t)})}catchUpgradeRequest=e=>{this.wsInternalSubscribedServers.has(e)||(S("subscribing to server upgrade event"),e.on("upgrade",this.handleUpgrade),this.wsInternalSubscribedServers.add(e))};handleUpgrade=async(e,t,r)=>{try{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o=await this.prepareProxyRequest(e,void 0);await this.proxy.ws(e,t,o,r),S("server upgrade event received. Proxying WebSocket")}}catch(r){this.proxy.emit("error",r,e,t)}};shouldProxy=(e,t)=>{try{return function(e="/",t,r){if(q(e))return B(e,t);if(K(e))return D(e,t);if(Array.isArray(e)){if(e.every(q)){var o=e,n=t;let r=!1;for(let e of o)if(B(e,n)){r=!0;break}return r}if(e.every(K))return D(e,t);throw new k('[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',"HPM_INVALID_PATH_FILTER_ARRAY_CONFIG")}if("function"==typeof e)return!!e(G(t),r);throw new k('[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',"HPM_INVALID_PATH_FILTER_CONFIG")}(e,t.url,t)}catch(e){return S("Error: matchPathFilter() called with request url: ",`"${t.url}"`),this.logger.error(e),!1}};prepareProxyRequest=async(e,t)=>{let r=Object.assign({},this.proxyOptions);return await this.applyRouter(e,t,r),r.target=Y(r.target,"target"),r.forward=Y(r.forward,"forward"),await this.applyPathRewrite(e,t,this.pathRewriter,r),r};applyRouter=async(e,t,r)=>{let o;r.router&&(o=await Q(e,t,r))&&(S('router new target: "%s"',o),r.target=o)};applyPathRewrite=async(e,t,r,o)=>{if(e.url&&r){let n=await r(e.url,e,t,o);"string"==typeof n?(S("pathRewrite new path: %s",n),e.url=n):S("pathRewrite: no rewritten path found: %s",e.url)}}}function ee(e){let{middleware:t}=new J(e);return t}S.extend("response-interceptor");export{ee as createProxyMiddleware};
14
+ %O`,e)})};function T(e){return e?.replace(/[<>]/g,e=>encodeURIComponent(e))??""}let L=(e,t)=>{e.on("error",(e,t,r,o)=>{if(!t||!r)throw e;if(r&&"function"==typeof r.writeHead){if(!r.headersSent){let t=function(e){let t;if(/HPE_INVALID/.test(e))return 502;if(/HPM_ERR_INVALID_MULTIPART_/.test(e))return 400;switch(e){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":t=504;break;default:t=500}return t}(e.code);r.writeHead(t)}let o=t.headers&&t.headers.host;r.end(`Error occurred while trying to proxy: ${T(o)}${T(t.url)}`)}else!r||"function"!=typeof r.write||"writeHead"in r||r.destroy()})},I={info:()=>{},warn:()=>{},error:()=>{}},F=(e,t)=>{let r=t.logger||I;e.on("error",(e,t,o,n)=>{let s=t?.headers?.host,i=`${s}${t?.url}`,a=`${n?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",i,a,e.code||e,"https://nodejs.org/api/errors.html#errors_common_system_errors")}),e.on("proxyRes",(e,o,n)=>{let s,i=o.originalUrl??`${o.baseUrl||""}${o.url}`;try{var c;let t=(c=e.req?.agent?.sockets,Object.keys(c||{})?.[0]?.split(":")[1]),{protocol:r,host:o,path:n}=e.req;s=function({protocol:e,host:t,port:r,path:o}){let n=t?.includes(":")?`[${t}]`:t,s=new u(`${e||"undefined:"}//${n||"[::]"}`);return r&&(s.port=r),o&&(s.pathname=o),s}({protocol:r,host:o,port:t,path:n})}catch(r){console.error("[HPM] Unexpected error while creating target URL",r),(s=new a(t.target)).pathname=e.req.path}let l=s.toString(),p=`[HPM] ${o.method} ${i} -> ${l} [${e.statusCode}]`;r.info(p)}),e.on("open",e=>{r.info("[HPM] Client connected: %o",e.address())}),e.on("close",(e,t,o)=>{r.info("[HPM] Client disconnected: %o",t.address())})};function P(e){return e.name||"[anonymous Function]"}let j=S.extend("proxy-events-plugin"),N=(e,t)=>{let r;if(t.on){for(r in t.on)if(Object.prototype.hasOwnProperty.call(t.on,r)){let o=t.on[r];if(!o)continue;j(`register event handler: "${r}" -> "${P(o)}"`),e.on(r,o)}}},M=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/is-glob/4.0.3/5f6010d19ebbd407d4ddad3f32ad93b07ae9baaa0b44d778899bd947e1a7324b/node_modules/is-glob/index.js"),U=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/micromatch/4.0.8/e3e5f26f16f8b95548bbbd14ad679e23348853c21837502922840101deaebdcd/node_modules/micromatch/index.js");function B(e,t){let r=G(t);return r?.indexOf(e)===0}function D(e,t){let r=U([G(t)],e);return r&&r.length>0}function G(e){return e&&new URL(e,"http://0.0.0.0").pathname}function q(e){return"string"==typeof e&&!M(e)}function K(e){return M(e)}function W(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let Z=S.extend("path-rewriter"),z=S.extend("router");async function Q(e,t,r){let o,n=r.router;return W(n)?o=function(e,t){let r,o=e.headers.host??"",n=e.url??"";for(let[e,i]of Object.entries(t))if(V(e)){var s;if(V(s=e)&&!s.startsWith("/")){let[t,s]=function(e){let t=e.indexOf("/");return[e.slice(0,t),e.slice(t)]}(e);if(o===t&&n.startsWith(s)){z('match: "%s" -> "%s"',e,r=i);break}}else if(n.startsWith(e)){z('match: "%s" -> "%s"',e,r=i);break}}else if(e===o){z('match: "%s" -> "%s"',o,r=i);break}return r}(e,n):"function"==typeof n&&(o=await n(e,t,r)),o}function V(e){return e.indexOf("/")>-1}let X=S.extend("ipv6");function Y(e,t){var r,o,n;let s="string"==typeof(r=e)?new URL(r):r instanceof URL?r:void 0;if(s&&(o=s.hostname).startsWith("[")&&o.endsWith("]")){let r="::"===(n=s.hostname.replace(/^\[|\]$/g,""))?(X("normalizing hostname unspecified IPv6 address (::) to loopback (::1)"),"::1"):n;return X('normalized IPv6 "%s" %s',t,e),{hostname:r,auth:s.username||s.password?`${s.username}:${s.password}`:void 0,pathname:s.pathname,port:s.port,protocol:s.protocol,search:s.search}}return e}class J{wsInternalSubscribedServers=new WeakSet;activeServers=new Set;proxyOptions;proxy;pathRewriter;logger;constructor(e){if(!e.target&&!e.router)throw new k('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',"ERR_CONFIG_FACTORY_TARGET_MISSING");this.proxyOptions=e,this.logger=e.logger||I,S("create proxy server"),this.proxy=function(e={}){return new w(e)}({}),this.registerPlugins(this.proxy,this.proxyOptions),this.pathRewriter=function(e){let t;if(function(e){if("function"==typeof e)return!0;if(W(e))return 0!==Object.keys(e).length;if(null==e)return!1;throw new k("[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function","HPM_INVALID_PATH_REWRITER_CONFIG")}(e))if("function"==typeof e)return e;else return t=function(e){let t=[];if(W(e))for(let[r,o]of Object.entries(e))t.push({regex:new RegExp(r),value:o}),Z('rewrite rule created: "%s" ~> "%s"',r,o);return t}(e),function(e){let r=e;for(let o of t)if(o.regex.test(e)){Z('rewriting path from "%s" to "%s"',e,r=r.replace(o.regex,o.value));break}return r}}(this.proxyOptions.pathRewrite),this.middleware.upgrade=(e,t,r)=>{let o=this.#e(e);o&&!this.wsInternalSubscribedServers.has(o)&&this.handleUpgrade(e,t,r)}}#e(e){return e.socket?.server}middleware=async(e,t,r)=>{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o;try{if(!(o=await this.prepareProxyRequest(e,t)).target&&!o.forward)throw Error("Must provide a proper URL as target")}catch(e){r?.(e);return}try{S("proxy request to target: %O",o.target),await this.proxy.web(e,t,o)}catch(n){this.proxy.emit("error",n,e,t,o.target),r?.(n)}}else r?.();let o=this.#e(e);o&&!this.activeServers.has(o)&&(S("registering server close listener"),this.activeServers.add(o),o.on("close",()=>{(S("server close signal received."),this.activeServers.delete(o),this.activeServers.size>0)?S(`proxy server not closed: ${this.activeServers.size} server(s) still active`):(S("closing proxy server"),this.proxy.close(()=>S("proxy server closed")))})),!0===this.proxyOptions.ws&&o&&this.catchUpgradeRequest(o)};registerPlugins(e,t){let r,o,n;(r=t.on?.error?[]:[L],o=t.ejectPlugins?[]:[H,N,F,...r],n=t.plugins??[],[...o,...n]).forEach(r=>{S(`register plugin: "${P(r)}"`),r(e,t)})}catchUpgradeRequest=e=>{this.wsInternalSubscribedServers.has(e)||(S("subscribing to server upgrade event"),e.on("upgrade",this.handleUpgrade),this.wsInternalSubscribedServers.add(e))};handleUpgrade=async(e,t,r)=>{try{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o=await this.prepareProxyRequest(e,void 0);await this.proxy.ws(e,t,o,r),S("server upgrade event received. Proxying WebSocket")}}catch(r){this.proxy.emit("error",r,e,t)}};shouldProxy=(e,t)=>{try{return function(e="/",t,r){if(q(e))return B(e,t);if(K(e))return D(e,t);if(Array.isArray(e)){if(e.every(q)){var o,n,s=e,i=t;let r=!1;for(let e of s)if(B(e,i)){r=!0;break}return r}if(e.every(K)){return o=e,n=t,D(o,n)}throw new k('[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',"HPM_INVALID_PATH_FILTER_ARRAY_CONFIG")}if("function"==typeof e)return!!e(G(t),r);throw new k('[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',"HPM_INVALID_PATH_FILTER_CONFIG")}(e,t.url,t)}catch(e){return S("Error: matchPathFilter() called with request url: ",`"${t.url}"`),this.logger.error(e),!1}};prepareProxyRequest=async(e,t)=>{let r=Object.assign({},this.proxyOptions);return await this.applyRouter(e,t,r),r.target=Y(r.target,"target"),r.forward=Y(r.forward,"forward"),await this.applyPathRewrite(e,t,this.pathRewriter,r),r};applyRouter=async(e,t,r)=>{let o;r.router&&(o=await Q(e,t,r))&&(S('router new target: "%s"',o),r.target=o)};applyPathRewrite=async(e,t,r,o)=>{if(e.url&&r){let n=await r(e.url,e,t,o);"string"==typeof n?(S("pathRewrite new path: %s",n),e.url=n):S("pathRewrite: no rewritten path found: %s",e.url)}}}function ee(e){let{middleware:t}=new J(e);return t}S.extend("response-interceptor");export{ee as createProxyMiddleware};
package/dist/m.js CHANGED
@@ -14,7 +14,7 @@ import { readFile } from "node:fs/promises";
14
14
  import node_zlib, { constants as external_node_zlib_constants } from "node:zlib";
15
15
  import { once } from "node:events";
16
16
  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";
17
- import { cachedImport, getTinyglobby } from "./r.js";
17
+ import { cachedImport as cachedImport_cachedImport, getTinyglobby } from "./r.js";
18
18
  var superClass, superClass1, __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
19
19
  let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
20
20
  moduleFactories.add({
@@ -2090,7 +2090,7 @@ let vendors_require = createRequire(import.meta.url);
2090
2090
  var cjs_0_default = compatGetDefaultExport(rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/deepmerge/4.3.1/56471899410038644780b3527c5076e78d3f57091a0da3ac0daf6d994929353d/node_modules/deepmerge/dist/cjs.js"));
2091
2091
  let setNodeEnv = (env)=>{
2092
2092
  process.env.NODE_ENV = env;
2093
- }, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj), objectPrototype = Object.prototype, helpers_getProto = Object.getPrototypeOf, isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && helpers_getProto(obj) === objectPrototype, helpers_castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
2093
+ }, isCI = ()=>!!process.env.CI && 'false' !== process.env.CI, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj), objectPrototype = Object.prototype, helpers_getProto = Object.getPrototypeOf, isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && helpers_getProto(obj) === objectPrototype, helpers_castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
2094
2094
  arr
2095
2095
  ], cloneDeep = (value)=>null == value ? value : cjs_0_default()({}, value, {
2096
2096
  isMergeableObject: isPlainObject
@@ -2148,7 +2148,7 @@ function pick(obj, keys) {
2148
2148
  for (let key of keys)void 0 !== obj[key] && (result[key] = obj[key]);
2149
2149
  return result;
2150
2150
  }
2151
- let isTTY = (type = 'stdout')=>('stdin' === type ? process.stdin.isTTY : process.stdout.isTTY) && !process.env.CI, getCrypto = cachedImport(()=>import("node:crypto"));
2151
+ let isTTY = (type = 'stdout')=>('stdin' === type ? process.stdin.isTTY : process.stdout.isTTY) && !isCI(), getCrypto = cachedImport_cachedImport(()=>import("node:crypto"));
2152
2152
  async function helpers_hash(data) {
2153
2153
  let crypto = await getCrypto();
2154
2154
  return crypto.hash ? crypto.hash('sha256', data, 'hex').slice(0, 16) : crypto.createHash('sha256').update(data).digest('hex').slice(0, 16);
@@ -2359,12 +2359,12 @@ function createEnvironmentAsyncHook() {
2359
2359
  return params;
2360
2360
  },
2361
2361
  callBatch: async ({ environment, args: params })=>{
2362
- let results = [];
2363
- for (let callback of [
2362
+ let callbacks = [
2364
2363
  ...preGroup,
2365
2364
  ...defaultGroup,
2366
2365
  ...postGroup
2367
- ]){
2366
+ ], results = [];
2367
+ for (let callback of callbacks){
2368
2368
  if (environment && callback.environment && callback.environment !== environment) continue;
2369
2369
  let result = await callback.handler(...params);
2370
2370
  results.push(result);
@@ -2391,12 +2391,12 @@ function createAsyncHook() {
2391
2391
  return params;
2392
2392
  },
2393
2393
  callBatch: async (...params)=>{
2394
- let results = [];
2395
- for (let callback of [
2394
+ let callbacks = [
2396
2395
  ...preGroup,
2397
2396
  ...defaultGroup,
2398
2397
  ...postGroup
2399
- ]){
2398
+ ], results = [];
2399
+ for (let callback of callbacks){
2400
2400
  let result = await callback(...params);
2401
2401
  results.push(result);
2402
2402
  }
@@ -3291,7 +3291,7 @@ function createPublicContext(context) {
3291
3291
  async function createContext(options, userConfig, logger, loadConfigResult) {
3292
3292
  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();
3293
3293
  return {
3294
- version: "2.2.10",
3294
+ version: "2.2.11",
3295
3295
  rootPath,
3296
3296
  configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
3297
3297
  configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
@@ -4096,7 +4096,7 @@ async function createCompiler_createCompiler(options) {
4096
4096
  rspackConfigs
4097
4097
  };
4098
4098
  }
4099
- let getChokidar = cachedImport(()=>import("./chokidar.js").then((m)=>m.chokidar_namespaceObject)), DEFAULT_WATCH_FILE_EVENTS = [
4099
+ let getChokidar = cachedImport_cachedImport(()=>import("./chokidar.js").then((m)=>m.chokidar_namespaceObject)), DEFAULT_WATCH_FILE_EVENTS = [
4100
4100
  'add',
4101
4101
  'change',
4102
4102
  'unlink'
@@ -5120,7 +5120,7 @@ function pluginExternals() {
5120
5120
  ] : autoExternalRules : externals;
5121
5121
  mergedExternals && chain.externals(mergedExternals);
5122
5122
  }), api.onBeforeCreateCompiler(({ bundlerConfigs })=>{
5123
- for (let config of bundlerConfigs)(Array.isArray(config.target) ? config.target.includes('webworker') : 'webworker' === config.target) && config.externals && delete config.externals;
5123
+ for (let config of bundlerConfigs)(Array.isArray(config.target) ? config.target.includes('webworker') : 'webworker' === config.target) && !config.output?.module && config.externals && delete config.externals;
5124
5124
  });
5125
5125
  }
5126
5126
  };
@@ -6000,7 +6000,7 @@ function doesChunkBelongToHtml({ chunk, htmlPluginData }) {
6000
6000
  let { options } = htmlPluginData.plugin;
6001
6001
  return recursiveChunkEntryNames(chunk).some((chunkName)=>isChunksFiltered(chunkName, options?.chunks, options?.excludeChunks));
6002
6002
  }
6003
- let getManifestPlugin = cachedImport(()=>import("./manifest-plugin.js").then(rspackRequire.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/node_modules/rspack-manifest-plugin/dist/index.js"))), isCSSPath = (filePath)=>filePath.endsWith('.css');
6003
+ 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/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/node_modules/rspack-manifest-plugin/dist/index.js"))), isCSSPath = (filePath)=>filePath.endsWith('.css');
6004
6004
  function normalizeManifestObjectConfig(manifest) {
6005
6005
  let defaultOptions = {
6006
6006
  prefix: !0,
@@ -6686,7 +6686,7 @@ function destroyStream(stream, suppress) {
6686
6686
  'number' == typeof fd && this.close();
6687
6687
  }), 'function' == typeof stream.addListener && suppress && (stream.removeAllListeners('error'), stream.addListener('error', ()=>{}));
6688
6688
  }
6689
- let getRangeParser = cachedImport(()=>import("./range-parser.js").then(createFakeNamespaceObject.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/range-parser/1.3.0/d49e5dcb9d0e39475844e240fad8cd1db6a58f4144f7ede43d9755e2fce5babc/node_modules/range-parser/index.js", 23))), parseRangeHeaders = async (value)=>{
6689
+ let getRangeParser = cachedImport_cachedImport(()=>import("./range-parser.js").then(createFakeNamespaceObject.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/range-parser/1.3.0/d49e5dcb9d0e39475844e240fad8cd1db6a58f4144f7ede43d9755e2fce5babc/node_modules/range-parser/index.js", 23))), parseRangeHeaders = async (value)=>{
6690
6690
  let { default: rangeParser } = await getRangeParser(), [len, rangeHeader] = value.split('|');
6691
6691
  return rangeParser(Number(len), rangeHeader, {
6692
6692
  combine: !0
@@ -7020,7 +7020,7 @@ function parseNode(line) {
7020
7020
  column: parts[4] ? +parts[4] : null
7021
7021
  } : null;
7022
7022
  }
7023
- let getTraceMapping = cachedImport(()=>import("./trace-mapping.js").then((m)=>m.trace_mapping_namespaceObject)), isValidMethodName = (methodName)=>'<unknown>' !== methodName && !/[\\/]/.test(methodName), isRspackRuntimeStack = (value)=>!!value && (value.includes('__webpack_require__') || value.startsWith('webpack/runtime/')), parseFrame = async (frame, fs, context, cache)=>{
7023
+ let getTraceMapping = cachedImport_cachedImport(()=>import("./trace-mapping.js").then((m)=>m.trace_mapping_namespaceObject)), isValidMethodName = (methodName)=>'<unknown>' !== methodName && !/[\\/]/.test(methodName), isRspackRuntimeStack = (value)=>!!value && (value.includes('__webpack_require__') || value.startsWith('webpack/runtime/')), parseFrame = async (frame, fs, context, cache)=>{
7024
7024
  let { file, column, lineNumber } = frame, sourceMapUrl = `${file}.map`, sourceMapPathPromise = cache.sourceMapPaths.get(sourceMapUrl);
7025
7025
  sourceMapPathPromise || (sourceMapPathPromise = getFileFromUrl(sourceMapUrl, fs, context).then((info)=>!info || 'errorCode' in info ? void 0 : info.filename), cache.sourceMapPaths.set(sourceMapUrl, sourceMapPathPromise));
7026
7026
  let sourceMapPath = await sourceMapPathPromise;
@@ -7408,7 +7408,7 @@ class BuildManager {
7408
7408
  this.compiler.close(()=>{
7409
7409
  resolve();
7410
7410
  });
7411
- });
7411
+ }), this.context.socketServer === this.socketServer && (this.context.socketServer = void 0);
7412
7412
  }
7413
7413
  readFileSync = (fileName)=>'readFileSync' in this.outputFileSystem ? this.outputFileSystem.readFileSync(fileName, 'utf-8') : node_fs.readFileSync(fileName, 'utf-8');
7414
7414
  async setupCompilationMiddleware() {
@@ -7422,7 +7422,7 @@ class BuildManager {
7422
7422
  this.assetsMiddleware = middleware;
7423
7423
  }
7424
7424
  }
7425
- let isCliShortcutsEnabled = (config)=>config.dev.cliShortcuts && isTTY('stdin');
7425
+ let activeInterfaces = 0, isCliShortcutsEnabled = (config)=>config.dev.cliShortcuts && isTTY('stdin');
7426
7426
  async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls, restartServer, customShortcuts, logger }) {
7427
7427
  let shortcuts = [
7428
7428
  {
@@ -7466,7 +7466,9 @@ async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls,
7466
7466
  let { createInterface } = await import("node:readline"), rl = createInterface({
7467
7467
  input: process.stdin
7468
7468
  });
7469
- return rl.on('line', (input)=>{
7469
+ return activeInterfaces++, rl.once('close', ()=>{
7470
+ --activeInterfaces > 0 && process.stdin.resume();
7471
+ }), rl.on('line', (input)=>{
7470
7472
  if ('h' === (input = input.trim().toLowerCase())) {
7471
7473
  let message = `\n ${color.bold(color.blue('Shortcuts:'))}\n`;
7472
7474
  for (let shortcut of shortcuts)message += ` ${shortcut.description}\n`;
@@ -8129,17 +8131,15 @@ let runner_run = async ({ bundlePath, ...runnerFactoryOptions })=>{
8129
8131
  cleanupCallbacks.add(callback);
8130
8132
  }, removeCleanup = (callback)=>{
8131
8133
  cleanupCallbacks.delete(callback);
8132
- }, shutdownRefCount = 0, setupGracefulShutdown = ()=>{
8133
- shutdownRefCount++;
8134
- let onSigterm = ()=>{
8135
- handleTermination(constants.signals.SIGTERM + 128);
8136
- };
8137
- process.once('SIGTERM', onSigterm);
8138
- let isCI = 'true' === process.env.CI, onStdinEnd = ()=>{
8139
- handleTermination(0);
8140
- };
8141
- return isCI || process.stdin.on('end', onStdinEnd), ()=>{
8142
- !(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', onSigterm), isCI || process.stdin.removeListener('end', onStdinEnd));
8134
+ }, shutdownRefCount = 0, onSigterm = ()=>{
8135
+ handleTermination(constants.signals.SIGTERM + 128);
8136
+ }, onStdinEnd = ()=>{
8137
+ handleTermination(0);
8138
+ }, setupGracefulShutdown = ()=>{
8139
+ 1 == ++shutdownRefCount && (process.once('SIGTERM', onSigterm), isCI() || process.stdin.on('end', onStdinEnd));
8140
+ let cleanedUp = !1;
8141
+ return ()=>{
8142
+ cleanedUp || (cleanedUp = !0, --shutdownRefCount > 0 || (process.removeListener('SIGTERM', onSigterm), process.stdin.removeListener('end', onStdinEnd)));
8143
8143
  };
8144
8144
  }, createHttpServer = async ({ serverConfig, middlewares })=>{
8145
8145
  if (serverConfig.https) {
@@ -8412,7 +8412,7 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
8412
8412
  }), logger.debug('create dev server done'), devServer;
8413
8413
  }
8414
8414
  async function startPreviewServer(context, config, { getPortSilently } = {}) {
8415
- let { logger } = context, { connect } = await import("./connect-next.js"), middlewares = connect(), { port, portTip } = await resolvePort(config), serverConfig = config.server, { host, headers, proxy, historyApiFallback, compress, base, cors } = serverConfig, assetPrefixes = context.environmentList.map((environment)=>environment.config.output.assetPrefix);
8415
+ let cleanupCliShortcuts, { logger } = context, { connect } = await import("./connect-next.js"), middlewares = connect(), { port, portTip } = await resolvePort(config), serverConfig = config.server, { host, headers, proxy, historyApiFallback, compress, base, cors } = serverConfig, assetPrefixes = context.environmentList.map((environment)=>environment.config.output.assetPrefix);
8416
8416
  context.publicPathnames = getPublicPathnames(assetPrefixes, base);
8417
8417
  let protocol = serverConfig.https ? 'https' : 'http', routes = getRoutes(context), urls = await getAddressUrls({
8418
8418
  protocol,
@@ -8422,7 +8422,7 @@ async function startPreviewServer(context, config, { getPortSilently } = {}) {
8422
8422
  serverConfig,
8423
8423
  middlewares
8424
8424
  }), cleanupGracefulShutdown = setupGracefulShutdown(), serverTerminator = getServerTerminator(httpServer), closingPromise = null, closeServer = async ()=>(closingPromise || (closingPromise = (async ()=>{
8425
- removeCleanup(closeServer), cleanupGracefulShutdown(), await serverTerminator();
8425
+ removeCleanup(closeServer), cleanupGracefulShutdown(), cleanupCliShortcuts?.(), await serverTerminator();
8426
8426
  })()), closingPromise), printUrls = (options)=>printServerURLs({
8427
8427
  urls,
8428
8428
  port,
@@ -8493,7 +8493,7 @@ async function startPreviewServer(context, config, { getPortSilently } = {}) {
8493
8493
  environments: context.environments
8494
8494
  }), registerCleanup(closeServer), printUrls(), cliShortcutsEnabled) {
8495
8495
  let shortcutsOptions = 'boolean' == typeof config.dev.cliShortcuts ? {} : config.dev.cliShortcuts;
8496
- await setupCliShortcuts({
8496
+ cleanupCliShortcuts = await setupCliShortcuts({
8497
8497
  openPage,
8498
8498
  closeServer,
8499
8499
  printUrls,
@@ -10010,10 +10010,15 @@ let canReadExport = (module)=>null !== module && ('object' == typeof module || '
10010
10010
  if ('default' === exportName) return canReadExport(configModule) && 'default' in configModule ? configModule.default : configModule;
10011
10011
  if (canReadExport(configModule) && Object.hasOwn(configModule, exportName)) return configModule[exportName];
10012
10012
  throw Error(`Cannot find export ${exportName} in config file: ${configPath}`);
10013
- }, loadWithJiti = async (configPath, exportName, fresh)=>{
10013
+ }, cachedImport = (importer)=>{
10014
+ let promise;
10015
+ return ()=>promise ??= importer().catch((error)=>{
10016
+ throw promise = void 0, error;
10017
+ });
10018
+ }, getJiti = cachedImport(()=>import("../compiled/jiti/lib/jiti.mjs")), loadWithJiti = async (configPath, exportName, fresh)=>{
10014
10019
  let createJiti;
10015
10020
  try {
10016
- ({ createJiti } = await import("../compiled/jiti/lib/jiti.mjs"));
10021
+ ({ createJiti } = await getJiti());
10017
10022
  } catch (error) {
10018
10023
  throw Error('The "jiti" package is required to load this config. Install it with your package manager.', {
10019
10024
  cause: error
@@ -10039,13 +10044,13 @@ let canReadExport = (module)=>null !== module && ('object' == typeof module || '
10039
10044
  function getConfigMeta(config) {
10040
10045
  if (null !== config && 'object' == typeof config && Object.hasOwn(config, CONFIG_META)) return config[CONFIG_META];
10041
10046
  }
10042
- let JS_CONFIG_REGEXP = /\.(?:js|mjs|cjs)$/, loadWithNative = async (configPath, fresh)=>{
10047
+ let getFreshImport = cachedImport(()=>import("./freshImport.js")), JS_CONFIG_REGEXP = /\.(?:js|mjs|cjs)$/, loadWithNative = async (configPath, fresh)=>{
10043
10048
  let configFileURL = pathToFileURL(configPath).href;
10044
10049
  if (!fresh) return {
10045
10050
  configModule: await import(configFileURL),
10046
10051
  dependencies: []
10047
10052
  };
10048
- let { freshImport } = await import("./freshImport.js"), freshImportResult = await freshImport(configFileURL);
10053
+ let { freshImport } = await getFreshImport(), freshImportResult = await freshImport(configFileURL);
10049
10054
  return freshImportResult ? {
10050
10055
  configModule: freshImportResult.result,
10051
10056
  dependencies: freshImportResult.dependencies.sort()
@@ -10200,7 +10205,7 @@ let applyServerOptions = (command)=>{
10200
10205
  };
10201
10206
  function setupCommands(argv) {
10202
10207
  let cli = ((name = "")=>new CAC(name))('rsbuild');
10203
- cli.version("2.2.10"), 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)', {
10208
+ cli.version("2.2.11"), 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)', {
10204
10209
  default: 'auto'
10205
10210
  }).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', {
10206
10211
  type: [
@@ -10265,7 +10270,7 @@ function setupCommands(argv) {
10265
10270
  }
10266
10271
  function showGreeting() {
10267
10272
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
10268
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.10\n`);
10273
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.11\n`);
10269
10274
  }
10270
10275
  function setupLogLevel(argv) {
10271
10276
  if (argv.length <= 3) return;
@@ -10287,5 +10292,5 @@ function runCLI({ argv = process.argv } = {}) {
10287
10292
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
10288
10293
  }
10289
10294
  }
10290
- let src_version = "2.2.10";
10295
+ let src_version = "2.2.11";
10291
10296
  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 +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/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/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/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/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.1.5/89f7707af419f049572b368960144ec499672d58192c3b3f77eb1567a07281e3/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,c=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=c,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},p){let h=t.get(r)-1,u=p.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(p.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 b=(0,i.generateManifest)(p,y,l),_=0===h;if(b=c(e).beforeEmit.call(b),_){let t=l.serialize(b);p.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}c(e).afterEmit.call(b)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/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/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/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.1.5/89f7707af419f049572b368960144ec499672d58192c3b3f77eb1567a07281e3/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}_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),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}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){return this.callStageRange(this.queryStageRange(a),...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 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)){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){return this.callStageRange(this.queryStageRange(a),...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 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)){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){return this.callStageRange(this.queryStageRange(a),...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 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 c=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==(c-=1)&&i()},e=>{c=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(c=0,l(e)):0==(c-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,c=0,l(e)}t||0!=--c||i()}if(c<=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 c=0,p=()=>{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(()=>{(c+=1)===r.length?i():p()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(c=r.length,l(e)):(c+=1)===r.length?i():p()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,c=r.length,l(e)}t||((c+=1)===r.length?i():p())}if(c===r.length)return};p()}}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)},c=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let p=0,h=()=>{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?c(e):p===r.length?i():h()},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?c(t):p===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,p=r.length,l(e)}s||(p+=1,void 0!==t?c(t):p===r.length?i():h())}if(p===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 c=0,p=()=>{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&&(a[0]=e),c===r.length?i(a[0]):p()},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&&(a[0]=t),c===r.length?i(a[0]):p())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,c=r.length,l(e)}t||((c+=1)===r.length?i(a[0]):p())}if(c===r.length)return};p()}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:()=>c,SyncHook:()=>l,SyncWaterfallHook:()=>p},{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/54ceb7b806dc8c324f87415cf04dd80d28fa7d41470a3b40d83aaf488c0a5cb8/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/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/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/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/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.1.5/89f7707af419f049572b368960144ec499672d58192c3b3f77eb1567a07281e3/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,c=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=c,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},p){let h=t.get(r)-1,u=p.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(p.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)(p,y,l),_=0===h;if(S=c(e).beforeEmit.call(S),_){let t=l.serialize(S);p.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}c(e).afterEmit.call(S)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/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/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/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.1.5/89f7707af419f049572b368960144ec499672d58192c3b3f77eb1567a07281e3/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}_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),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}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){return this.callStageRange(this.queryStageRange(a),...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 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)){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){return this.callStageRange(this.queryStageRange(a),...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 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)){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){return this.callStageRange(this.queryStageRange(a),...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 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 c=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==(c-=1)&&i()},e=>{c=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(c=0,l(e)):0==(c-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,c=0,l(e)}t||0!=--c||i()}if(c<=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 c=0,p=()=>{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(()=>{(c+=1)===r.length?i():p()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(c=r.length,l(e)):(c+=1)===r.length?i():p()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,c=r.length,l(e)}t||((c+=1)===r.length?i():p())}if(c===r.length)return};p()}}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)},c=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let p=0,h=()=>{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?c(e):p===r.length?i():h()},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?c(t):p===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,p=r.length,l(e)}s||(p+=1,void 0!==t?c(t):p===r.length?i():h())}if(p===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 c=0,p=()=>{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&&(a[0]=e),c===r.length?i(a[0]):p()},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&&(a[0]=t),c===r.length?i(a[0]):p())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,c=r.length,l(e)}t||((c+=1)===r.length?i(a[0]):p())}if(c===r.length)return};p()}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:()=>c,SyncHook:()=>l,SyncWaterfallHook:()=>p},{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/12a6328c2e9bf08e26b58fdf2ee8c0ecfe31cb73b1db951f7711492f8c9e3b25/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};