@rsbuild/core 2.3.3 → 2.3.5
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.
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/http-proxy-middleware/index.d.ts +2 -0
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss-loader/index.js +160 -38
- package/compiled/postcss-loader/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +3 -0
- package/dist/client/hmr.js +19 -8
- package/dist/http-proxy-middleware.js +8 -4
- package/dist/index.d.ts +1 -1
- package/dist/m.js +234 -121
- package/dist/manifest-plugin.js +1 -1
- package/dist/range-parser.js +86 -48
- package/dist/rslib-runtime.js +9 -6
- package/dist/server/buildManager.d.ts +3 -2
- package/dist/server/devServer.d.ts +2 -0
- package/dist/server/socketServer.d.ts +9 -2
- package/dist/types/config.d.ts +7 -2
- package/package.json +8 -12
- package/types.d.ts +9 -0
package/dist/manifest-plugin.js
CHANGED
|
@@ -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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/17497e64d22a6c2a8eb2700029cf278579ead3c64963d770513f8f60bb2e2fa4/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/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/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/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/node_modules/rspack-manifest-plugin/dist/hooks.js"(t,s){s.getCompilerHooks=s.emitHook=s.beforeRunHook=void 0;let n=r("node:fs"),a=r("node:path"),o=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/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/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 o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.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:o,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,o),y)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,a.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,a.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/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/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"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/node_modules/rspack-manifest-plugin/dist/hooks.js");Object.defineProperty(s,"getCompilerHooks",{enumerable:!0,get:function(){return a.getCompilerHooks}});let o=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=a.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=a.emitHook.bind(this,{compiler:e,emitCountMap:o,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 a{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(o),...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(o),...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(o).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 o=[-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,a]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<a?s.push(e):1/0===a&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends a{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,a=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(a);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),o(e)}}1/0===r&&(this._runDoneInterceptors(),o(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(o),...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 a{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,a=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(a);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),o(e)}if(void 0!==t)return this._runResultInterceptors(t),o(null,t)}1/0===r&&(this._runDoneInterceptors(),o(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(o),...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 a{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,a=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(a);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),o(e)}}1/0===r&&(this._runDoneInterceptors(),o(null,i[0]))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(o),...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 a{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),a=t[t.length-1],o=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...o);let i=()=>{this._runDoneInterceptors(),a(null)},l=e=>{this._runErrorInterceptors(e),a(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(...o);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(...o,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...o)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends a{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),a=t[t.length-1],o=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...o);let i=()=>{this._runDoneInterceptors(),a(null)},l=e=>{this._runErrorInterceptors(e),a(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(...o);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(...o,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...o)}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 a{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),a=t[t.length-1],o=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...o);let i=()=>{this._runDoneInterceptors(),a(null)},l=e=>{this._runErrorInterceptors(e),a(e)},p=e=>{this._runResultInterceptors(e),a(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(...o);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(...o,(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(...o)}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 a{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),a=t[t.length-1],o=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...o);let i=e=>{this._runResultInterceptors(e),a(null,e)},l=e=>{this._runErrorInterceptors(e),a(e)};if(0===r.length)return i(o[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...o);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(o[0]=e),p===r.length?i(o[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...o,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(o[0]=t),p===r.length?i(o[0]):c())});else{let t=!1;try{let t=e.fn(...o);void 0!==t&&(o[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(o[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:()=>a,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/a5aff6a67a64dc2cd6fba2fe392c361454bba759c9980bb6bfe1a6686c72e73b/node_modules/rspack-manifest-plugin/dist/index.js");var a=n.RspackManifestPlugin,o=n.WebpackManifestPlugin,i=n.__esModule,l=n.getCompilerHooks;export{a as RspackManifestPlugin,o as WebpackManifestPlugin,i as __esModule,l as getCompilerHooks};
|
package/dist/range-parser.js
CHANGED
|
@@ -1,55 +1,93 @@
|
|
|
1
1
|
/*! LICENSE: range-parser.js.LICENSE.txt */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
function format(obj) {
|
|
3
|
+
let { type, ranges } = obj;
|
|
4
|
+
if (!type || /[^!#$%&'*+\-.^_`|~0-9A-Za-z]/.test(type)) throw TypeError("Invalid range type");
|
|
5
|
+
if (!ranges || 0 === ranges.length) throw TypeError("At least one range is required");
|
|
6
|
+
let parts = [];
|
|
7
|
+
for (let range of ranges){
|
|
8
|
+
if (!range || !Number.isSafeInteger(range.start) || !Number.isSafeInteger(range.end) || range.start < 0 || range.end < range.start) throw TypeError("Invalid range");
|
|
9
|
+
parts.push(`${range.start}-${range.end}`);
|
|
10
|
+
}
|
|
11
|
+
return `${type}=${parts.join(",")}`;
|
|
12
|
+
}
|
|
13
|
+
function parse(size, str) {
|
|
14
|
+
if (!Number.isSafeInteger(size) || size < 0) throw TypeError(`Invalid size: ${size}`);
|
|
15
|
+
let ranges = [], eqIndex = str.indexOf("=");
|
|
16
|
+
if (-1 === eqIndex) return {
|
|
17
|
+
code: 1,
|
|
18
|
+
type: "",
|
|
19
|
+
ranges
|
|
20
|
+
};
|
|
21
|
+
let type = str.slice(0, eqIndex).toLowerCase(), len = str.length, index = eqIndex + 1, code = 0, hasRange = !1, dashIndex = -1;
|
|
22
|
+
do {
|
|
23
|
+
let commaIndex = str.indexOf(",", index), endIndex = -1 !== commaIndex ? commaIndex : len, startStrIndex = index, endStrIndex = endIndex;
|
|
24
|
+
for(; 32 === str.charCodeAt(startStrIndex) || 9 === str.charCodeAt(startStrIndex);)startStrIndex++;
|
|
25
|
+
for(; 32 === str.charCodeAt(endStrIndex - 1) || 9 === str.charCodeAt(endStrIndex - 1);)endStrIndex--;
|
|
26
|
+
if (index = endIndex + 1, startStrIndex >= endStrIndex) continue;
|
|
27
|
+
if (hasRange = !0, dashIndex < startStrIndex && -1 === (dashIndex = str.indexOf("-", startStrIndex)) && (dashIndex = len), dashIndex >= endStrIndex) {
|
|
28
|
+
code |= 1;
|
|
29
|
+
continue;
|
|
7
30
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
31
|
+
let start = 0 / 0, end = 0 / 0;
|
|
32
|
+
if (startStrIndex === dashIndex) {
|
|
33
|
+
if (endStrIndex === dashIndex + 1) {
|
|
34
|
+
code |= 1;
|
|
35
|
+
continue;
|
|
12
36
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
function mapWithoutIndex(range) {
|
|
25
|
-
return {
|
|
26
|
-
start: range.start,
|
|
27
|
-
end: range.end
|
|
28
|
-
};
|
|
37
|
+
let suffixLength = parsePos(str, dashIndex + 1, endStrIndex);
|
|
38
|
+
if (0 === size && suffixLength > 0) continue;
|
|
39
|
+
start = Math.max(size - suffixLength, 0), end = size - 1;
|
|
40
|
+
} else if (start = parsePos(str, startStrIndex, dashIndex), endStrIndex === dashIndex + 1) end = size - 1;
|
|
41
|
+
else {
|
|
42
|
+
if (start > (end = parsePos(str, dashIndex + 1, endStrIndex))) {
|
|
43
|
+
code |= 1;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
end > size - 1 && (end = size - 1);
|
|
29
47
|
}
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
if (Number.isNaN(start) || Number.isNaN(end)) {
|
|
49
|
+
code |= 1;
|
|
50
|
+
continue;
|
|
32
51
|
}
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
if (start > end) {
|
|
53
|
+
code |= 2;
|
|
54
|
+
continue;
|
|
35
55
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
ranges.push({
|
|
57
|
+
start: start,
|
|
58
|
+
end: end
|
|
59
|
+
});
|
|
60
|
+
}while (index < len);
|
|
61
|
+
return hasRange ? {
|
|
62
|
+
code,
|
|
63
|
+
type,
|
|
64
|
+
ranges
|
|
65
|
+
} : {
|
|
66
|
+
code: 1,
|
|
67
|
+
type,
|
|
68
|
+
ranges
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function parsePos(str, start, end) {
|
|
72
|
+
let value = 0;
|
|
73
|
+
for(let i = start; i < end; i++){
|
|
74
|
+
let code = str.charCodeAt(i);
|
|
75
|
+
if (code < 48 || code > 57) return 0 / 0;
|
|
76
|
+
value = 10 * value + (code - 48);
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
function combineRanges(ranges) {
|
|
81
|
+
if (0 === ranges.length) return [];
|
|
82
|
+
let ordered = ranges.map((range, index)=>({
|
|
83
|
+
start: range.start,
|
|
84
|
+
end: range.end,
|
|
85
|
+
index
|
|
86
|
+
})).sort((a, b)=>a.start - b.start), j = 0;
|
|
87
|
+
for(let i = 1; i < ordered.length; i++){
|
|
88
|
+
let range = ordered[i], current = ordered[j];
|
|
89
|
+
range.start > current.end + 1 ? ordered[++j] = range : (current.end = Math.max(current.end, range.end), current.index = Math.min(current.index, range.index));
|
|
54
90
|
}
|
|
55
|
-
|
|
91
|
+
return ordered.length = j + 1, ordered.sort((a, b)=>a.index - b.index);
|
|
92
|
+
}
|
|
93
|
+
export { combineRanges, format, parse };
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -12,12 +12,12 @@ var moduleFactories = modules, compatGetDefaultExport = (module)=>{
|
|
|
12
12
|
return definePropertyGetters(getter, {
|
|
13
13
|
a: getter
|
|
14
14
|
}), getter;
|
|
15
|
-
}, getProto = Object.getPrototypeOf
|
|
15
|
+
}, getProto = Object.getPrototypeOf, createFakeNamespaceObject = function(value, mode) {
|
|
16
16
|
if (1 & mode && (value = ("function" == typeof this ? this : this.r)(value)), 8 & mode || 'object' == typeof value && value && (4 & mode && value.__esModule || 16 & mode && 'function' == typeof value.then)) return value;
|
|
17
17
|
var ns = Object.create(null);
|
|
18
18
|
makeNamespaceObject(ns);
|
|
19
19
|
var def = {};
|
|
20
|
-
leafPrototypes
|
|
20
|
+
leafPrototypes ||= [
|
|
21
21
|
null,
|
|
22
22
|
getProto({}),
|
|
23
23
|
getProto([]),
|
|
@@ -40,10 +40,13 @@ moduleFactories.add = function registerModules(modules) {
|
|
|
40
40
|
Object.assign(moduleFactories, modules);
|
|
41
41
|
};
|
|
42
42
|
var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
Object.defineProperties(exports, {
|
|
44
|
+
[Symbol.toStringTag]: {
|
|
45
|
+
value: 'Module'
|
|
46
|
+
},
|
|
47
|
+
__esModule: {
|
|
48
|
+
value: !0
|
|
49
|
+
}
|
|
47
50
|
});
|
|
48
51
|
};
|
|
49
52
|
export { rspackRequire, moduleFactories, compatGetDefaultExport, createFakeNamespaceObject, definePropertyGetters, makeNamespaceObject };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { InternalContext, NormalizedConfig, Rspack } from '../types/index.js';
|
|
2
2
|
import { type AssetsMiddleware } from './assets-middleware/index.js';
|
|
3
|
-
import { type SocketConnectionListener, SocketServer } from './socketServer.js';
|
|
3
|
+
import { type SocketConnectionListener, type SocketCustomMessageListener, SocketServer } from './socketServer.js';
|
|
4
4
|
type Options = {
|
|
5
5
|
context: InternalContext;
|
|
6
6
|
config: NormalizedConfig;
|
|
7
7
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
8
8
|
resolvedPort: number;
|
|
9
9
|
onSocketConnect?: SocketConnectionListener;
|
|
10
|
+
onSocketCustomMessage?: SocketCustomMessageListener;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Setup compiler related logic:
|
|
@@ -20,7 +21,7 @@ type Options = {
|
|
|
20
21
|
private config;
|
|
21
22
|
private resolvedPort;
|
|
22
23
|
private context;
|
|
23
|
-
constructor({ config, context, compiler, resolvedPort, onSocketConnect }: Options);
|
|
24
|
+
constructor({ config, context, compiler, resolvedPort, onSocketConnect, onSocketCustomMessage }: Options);
|
|
24
25
|
init(): Promise<void>;
|
|
25
26
|
/**
|
|
26
27
|
* Call `compiler.watch()` to start compiling.
|
|
@@ -15,6 +15,8 @@ export type HotClient = {
|
|
|
15
15
|
};
|
|
16
16
|
type HotConnectCallback = (client: HotClient) => void | Promise<void>;
|
|
17
17
|
export type HotOnConnect = (callback: HotConnectCallback) => () => void;
|
|
18
|
+
type HotEventCallback<Data = any> = (data: Data, client: HotClient) => void | Promise<void>;
|
|
19
|
+
export type HotOn = <Data = any>(event: string, callback: HotEventCallback<Data>) => () => void;
|
|
18
20
|
export type RsbuildDevServer = RsbuildServerBase & {
|
|
19
21
|
/**
|
|
20
22
|
* Notifies Rsbuild that the custom server has successfully started.
|
|
@@ -66,8 +66,14 @@ export type ClientMessageError = {
|
|
|
66
66
|
export type ClientMessagePing = {
|
|
67
67
|
type: 'ping';
|
|
68
68
|
};
|
|
69
|
-
export type
|
|
69
|
+
export type ClientMessageCustom = {
|
|
70
|
+
type: 'custom';
|
|
71
|
+
event: string;
|
|
72
|
+
data?: unknown;
|
|
73
|
+
};
|
|
74
|
+
export type ClientMessage = ClientMessagePing | ClientMessageError | ClientMessageCustom;
|
|
70
75
|
export type SocketConnectionListener = (socket: WebSocket, token: string) => void;
|
|
76
|
+
export type SocketCustomMessageListener = (socket: WebSocket, token: string, event: string, data: unknown) => void;
|
|
71
77
|
export declare class SocketServer {
|
|
72
78
|
private wsServer;
|
|
73
79
|
private readonly socketsMap;
|
|
@@ -83,7 +89,8 @@ export declare class SocketServer {
|
|
|
83
89
|
* multi-environment build is done, keyed by WebSocket token.
|
|
84
90
|
*/ private environmentStats;
|
|
85
91
|
private onSocketConnect?;
|
|
86
|
-
|
|
92
|
+
private onSocketCustomMessage?;
|
|
93
|
+
constructor(context: InternalContext, options: DevConfig, getOutputFileSystem: () => Rspack.OutputFileSystem, onSocketConnect?: SocketConnectionListener, onSocketCustomMessage?: SocketCustomMessageListener);
|
|
87
94
|
// subscribe upgrade event to handle socket
|
|
88
95
|
upgrade: (req: IncomingMessage, socket: Socket, head: Buffer) => void;
|
|
89
96
|
// detect and close broken connections
|
package/dist/types/config.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type Cors from '../../compiled/cors/index.js';
|
|
|
8
8
|
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
|
|
9
9
|
import type { RspackChain } from '../../compiled/rspack-chain/types/index.js';
|
|
10
10
|
import type { FileDescriptor } from '../../compiled/rspack-manifest-plugin/index.js';
|
|
11
|
-
import type { HotOnConnect, HotSend, RsbuildDevServer } from '../server/devServer.js';
|
|
11
|
+
import type { HotOn, HotOnConnect, HotSend, RsbuildDevServer } from '../server/devServer.js';
|
|
12
12
|
import type { RsbuildPreviewServer } from '../server/previewServer.js';
|
|
13
13
|
import type { Logger } from '../logger.js';
|
|
14
14
|
import type { EnvironmentContext, ModifyBundlerChainUtils, ModifyChainUtils, ReadonlyRoutes, WatchFileEvent } from './hooks.js';
|
|
@@ -1478,6 +1478,11 @@ export type EnvironmentAPI = Record<string, {
|
|
|
1478
1478
|
* Listen for accepted HMR connections in this environment.
|
|
1479
1479
|
* Returns a function that removes the listener.
|
|
1480
1480
|
*/ onConnect: HotOnConnect;
|
|
1481
|
+
/**
|
|
1482
|
+
* Listen for custom events sent by `import.meta.webpackHot.send()`
|
|
1483
|
+
* from HMR clients in this environment.
|
|
1484
|
+
* Returns a function that removes the listener.
|
|
1485
|
+
*/ on: HotOn;
|
|
1481
1486
|
};
|
|
1482
1487
|
/**
|
|
1483
1488
|
* Provides some context information about the current environment
|
|
@@ -1599,7 +1604,7 @@ export interface DevConfig {
|
|
|
1599
1604
|
};
|
|
1600
1605
|
/**
|
|
1601
1606
|
* Whether to enable Hot Module Replacement.
|
|
1602
|
-
* @default true
|
|
1607
|
+
* @default true in `development` mode, false otherwise
|
|
1603
1608
|
*/ hmr?: boolean;
|
|
1604
1609
|
/**
|
|
1605
1610
|
* Whether to reload the page when file changes are detected.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
|
-
".":
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"default": "./dist/index.js"
|
|
20
|
-
},
|
|
17
|
+
".": "./dist/index.js",
|
|
21
18
|
"./jiti": {
|
|
22
19
|
"types": "./compiled/jiti/lib/jiti.d.mts",
|
|
23
20
|
"default": "./compiled/jiti/lib/jiti.mjs"
|
|
@@ -39,7 +36,7 @@
|
|
|
39
36
|
"types.d.ts"
|
|
40
37
|
],
|
|
41
38
|
"dependencies": {
|
|
42
|
-
"@rspack/core": "~2.3.
|
|
39
|
+
"@rspack/core": "~2.3.4",
|
|
43
40
|
"@swc/helpers": "^0.5.24"
|
|
44
41
|
},
|
|
45
42
|
"devDependencies": {
|
|
@@ -49,10 +46,9 @@
|
|
|
49
46
|
"@rstackjs/load-config": "^1.0.2",
|
|
50
47
|
"@types/cors": "^2.8.19",
|
|
51
48
|
"@types/node": "^26.6.6",
|
|
52
|
-
"@types/range-parser": "^1.2.7",
|
|
53
49
|
"@types/ws": "^8.18.2",
|
|
54
50
|
"browserslist-load-config": "^1.0.4",
|
|
55
|
-
"cac": "^7.1.
|
|
51
|
+
"cac": "^7.1.1",
|
|
56
52
|
"chokidar": "^6.0.0",
|
|
57
53
|
"connect-next": "5.0.0",
|
|
58
54
|
"core-js": "^3.51.0",
|
|
@@ -62,7 +58,7 @@
|
|
|
62
58
|
"dotenv-expand": "^13.0.0",
|
|
63
59
|
"fresh-import": "^0.2.1",
|
|
64
60
|
"html-rspack-plugin": "6.1.11",
|
|
65
|
-
"http-proxy-middleware": "4.2.
|
|
61
|
+
"http-proxy-middleware": "4.2.2",
|
|
66
62
|
"jiti": "^2.7.0",
|
|
67
63
|
"launch-editor-middleware": "^2.14.2",
|
|
68
64
|
"memfs": "4.80.1",
|
|
@@ -70,12 +66,12 @@
|
|
|
70
66
|
"open": "^11.0.4",
|
|
71
67
|
"postcss": "^8.5.33",
|
|
72
68
|
"postcss-load-config": "6.0.1",
|
|
73
|
-
"postcss-loader": "8.2.
|
|
69
|
+
"postcss-loader": "8.2.2",
|
|
74
70
|
"prebundle": "1.6.5",
|
|
75
|
-
"range-parser": "^
|
|
71
|
+
"range-parser": "^2.0.0",
|
|
76
72
|
"reduce-configs": "^2.0.1",
|
|
77
73
|
"rslog": "^2.3.0",
|
|
78
|
-
"rspack-chain": "^2.
|
|
74
|
+
"rspack-chain": "^2.4.0",
|
|
79
75
|
"rspack-manifest-plugin": "5.2.2",
|
|
80
76
|
"rspack-merge": "1.0.1",
|
|
81
77
|
"sirv": "^3.0.2",
|
package/types.d.ts
CHANGED
|
@@ -80,7 +80,16 @@ interface ImportMeta {
|
|
|
80
80
|
|
|
81
81
|
declare namespace Rspack {
|
|
82
82
|
interface Hot {
|
|
83
|
+
/**
|
|
84
|
+
* Listen for custom events sent by the dev server.
|
|
85
|
+
*/
|
|
83
86
|
on: <Data = any>(event: string, cb: (data: Data) => void) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Send a custom event to the dev server, handled by
|
|
89
|
+
* `server.environments[name].hot.on()`.
|
|
90
|
+
* The data must be JSON serializable.
|
|
91
|
+
*/
|
|
92
|
+
send: <Data = unknown>(event: string, data?: Data) => void;
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
95
|
|