@rsbuild/core 2.2.0-rc.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/jiti/dist/babel.cjs +13449 -13449
- package/compiled/postcss-loader/index.js +6 -6
- package/dist/626.js +25 -23
- package/dist/manifest-plugin.js +1 -1
- package/dist/server/assets-middleware/index.d.ts +0 -1
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
534: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(836)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
836: (__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__(
|
|
12
|
+
var _utils = __nccwpck_require__(357);
|
|
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
|
-
|
|
182
|
+
357: (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__(
|
|
719
|
+
var __webpack_exports__ = __nccwpck_require__(534);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
package/dist/626.js
CHANGED
|
@@ -3079,30 +3079,30 @@ async function initPlugins({ context, pluginManager }) {
|
|
|
3079
3079
|
context.logger.debug('initializing plugins');
|
|
3080
3080
|
let plugins = pluginManager.getAllPluginsWithMeta();
|
|
3081
3081
|
plugins = ((plugins)=>{
|
|
3082
|
-
let allLines = [];
|
|
3082
|
+
let allLines = [], pluginNames = new Set(plugins.map((item)=>item.instance.name));
|
|
3083
3083
|
function getPlugin(name) {
|
|
3084
3084
|
let targets = plugins.filter((item)=>item.instance.name === name);
|
|
3085
3085
|
if (!targets.length) throw Error(`${color.dim('[rsbuild:plugin]')} Plugin "${color.yellow(name)}" not existed`);
|
|
3086
3086
|
return targets;
|
|
3087
3087
|
}
|
|
3088
3088
|
for (let plugin of plugins){
|
|
3089
|
-
if (plugin.instance.pre) for (let pre of plugin.instance.pre)pre &&
|
|
3089
|
+
if (plugin.instance.pre) for (let pre of plugin.instance.pre)pre && pluginNames.has(pre) && allLines.push([
|
|
3090
3090
|
pre,
|
|
3091
3091
|
plugin.instance.name
|
|
3092
3092
|
]);
|
|
3093
|
-
if (plugin.instance.post) for (let post of plugin.instance.post)post &&
|
|
3093
|
+
if (plugin.instance.post) for (let post of plugin.instance.post)post && pluginNames.has(post) && allLines.push([
|
|
3094
3094
|
plugin.instance.name,
|
|
3095
3095
|
post
|
|
3096
3096
|
]);
|
|
3097
3097
|
}
|
|
3098
|
-
let
|
|
3098
|
+
let endPoints = new Set(allLines.map((line)=>line[1])), zeroEndPoints = plugins.filter((item)=>!endPoints.has(item.instance.name)), sortedPoint = [], sortedPluginNames = new Set();
|
|
3099
3099
|
for(; zeroEndPoints.length;){
|
|
3100
|
-
let pluginInstances = getPlugin(
|
|
3101
|
-
sortedPoint.push(...pluginInstances), allLines = allLines.filter((
|
|
3100
|
+
let { name } = zeroEndPoints[0].instance, pluginInstances = getPlugin(name);
|
|
3101
|
+
sortedPoint.push(...pluginInstances), sortedPluginNames.add(name), endPoints = new Set((allLines = allLines.filter((line)=>line[0] !== name)).map((line)=>line[1])), zeroEndPoints = plugins.filter((item)=>!sortedPluginNames.has(item.instance.name) && !endPoints.has(item.instance.name));
|
|
3102
3102
|
}
|
|
3103
3103
|
if (allLines.length) {
|
|
3104
3104
|
let restInRingPoints = {};
|
|
3105
|
-
for (let
|
|
3105
|
+
for (let line of allLines)restInRingPoints[line[0]] = !0, restInRingPoints[line[1]] = !0;
|
|
3106
3106
|
throw Error(`${color.dim('[rsbuild:plugin]')} Plugins dependencies has loop: ${color.yellow(Object.keys(restInRingPoints).join(','))}`);
|
|
3107
3107
|
}
|
|
3108
3108
|
return sortedPoint;
|
|
@@ -3425,7 +3425,7 @@ function createPublicContext(context) {
|
|
|
3425
3425
|
async function createContext(options, userConfig, logger, loadConfigResult) {
|
|
3426
3426
|
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();
|
|
3427
3427
|
return {
|
|
3428
|
-
version: "2.2.0
|
|
3428
|
+
version: "2.2.0",
|
|
3429
3429
|
rootPath,
|
|
3430
3430
|
configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
|
|
3431
3431
|
configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
|
|
@@ -6339,6 +6339,7 @@ function resolveDefaultPreset(config) {
|
|
|
6339
6339
|
}
|
|
6340
6340
|
function resolvePerPackagePreset() {
|
|
6341
6341
|
return {
|
|
6342
|
+
chunks: 'all',
|
|
6342
6343
|
minSize: 0,
|
|
6343
6344
|
maxInitialRequests: 1 / 0,
|
|
6344
6345
|
cacheGroups: {
|
|
@@ -6566,7 +6567,11 @@ async function resolveHostname(host = LOCALHOST) {
|
|
|
6566
6567
|
}
|
|
6567
6568
|
return void 0 === host || WILDCARD_HOSTS.has(host) ? LOCALHOST : host;
|
|
6568
6569
|
}
|
|
6569
|
-
let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)
|
|
6570
|
+
let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/, getFileFromUrl_stat = (filename, outputFileSystem)=>new Promise((resolve, reject)=>{
|
|
6571
|
+
outputFileSystem.stat(filename, (err, stats)=>{
|
|
6572
|
+
err ? reject(err) : resolve(stats);
|
|
6573
|
+
});
|
|
6574
|
+
});
|
|
6570
6575
|
async function getFileFromUrl(url, outputFileSystem, context) {
|
|
6571
6576
|
let pathname = getPathnameFromUrl(url);
|
|
6572
6577
|
try {
|
|
@@ -6583,11 +6588,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6583
6588
|
if (UP_PATH_REGEXP.test(node_path.normalize(`./${pathname}`))) return {
|
|
6584
6589
|
errorCode: 403
|
|
6585
6590
|
};
|
|
6586
|
-
let
|
|
6587
|
-
outputFileSystem.stat(filename, (err, stats)=>{
|
|
6588
|
-
err ? reject(err) : resolve(stats);
|
|
6589
|
-
});
|
|
6590
|
-
}), { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
|
|
6591
|
+
let { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
|
|
6591
6592
|
for (let [index, distPath] of distPaths.entries()){
|
|
6592
6593
|
let prefix = publicPathnames[index];
|
|
6593
6594
|
prefix && '/' !== prefix && isUrlPathUnderBase(pathname, prefix) && possibleFilenames.add(node_path.join(distPath, pathname.slice(prefix.length)));
|
|
@@ -6596,7 +6597,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6596
6597
|
for (let filename of possibleFilenames){
|
|
6597
6598
|
let fsStats;
|
|
6598
6599
|
try {
|
|
6599
|
-
fsStats = await
|
|
6600
|
+
fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
|
|
6600
6601
|
} catch {
|
|
6601
6602
|
continue;
|
|
6602
6603
|
}
|
|
@@ -6608,7 +6609,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6608
6609
|
if (fsStats.isDirectory()) {
|
|
6609
6610
|
filename = node_path.join(filename, 'index.html');
|
|
6610
6611
|
try {
|
|
6611
|
-
fsStats = await
|
|
6612
|
+
fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
|
|
6612
6613
|
} catch {
|
|
6613
6614
|
continue;
|
|
6614
6615
|
}
|
|
@@ -6893,8 +6894,8 @@ function applyHMREntry({ config, compiler, token, resolvedHost, resolvedPort })
|
|
|
6893
6894
|
var overlay;
|
|
6894
6895
|
let overlay1;
|
|
6895
6896
|
if (!((compiler)=>{
|
|
6896
|
-
let {
|
|
6897
|
-
return !!
|
|
6897
|
+
let { platform } = compiler;
|
|
6898
|
+
return !!(platform.web && !platform.webworker && compiler.options.output.environment?.document);
|
|
6898
6899
|
})(compiler) || !config.dev.hmr && !config.dev.liveReload) return;
|
|
6899
6900
|
let { enabled: liveReloadEnabled } = normalizeLiveReload(config.dev.liveReload), { webSocketUrlResolver, ...clientConfig } = {
|
|
6900
6901
|
...config.dev.client
|
|
@@ -9393,7 +9394,8 @@ try {
|
|
|
9393
9394
|
else {
|
|
9394
9395
|
let { preset = 'none', ...rest } = splitChunks;
|
|
9395
9396
|
chain.optimization.splitChunks({
|
|
9396
|
-
chunks: 'all',
|
|
9397
|
+
chunks: Object.keys(environment.entry).length > 1 ? 'all' : 'async',
|
|
9398
|
+
minSize: 0,
|
|
9397
9399
|
...getSplitChunksByPreset(config, preset),
|
|
9398
9400
|
...rest
|
|
9399
9401
|
});
|
|
@@ -9656,7 +9658,7 @@ try {
|
|
|
9656
9658
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
|
|
9657
9659
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
9658
9660
|
if (!1 === manifest) return;
|
|
9659
|
-
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0
|
|
9661
|
+
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
9660
9662
|
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
9661
9663
|
let pluginOptions = {
|
|
9662
9664
|
fileName: manifestOptions.filename,
|
|
@@ -10199,7 +10201,7 @@ let applyServerOptions = (command)=>{
|
|
|
10199
10201
|
};
|
|
10200
10202
|
function setupCommands(argv) {
|
|
10201
10203
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
10202
|
-
cli.version("2.2.0
|
|
10204
|
+
cli.version("2.2.0"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
|
|
10203
10205
|
default: 'auto'
|
|
10204
10206
|
}).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', {
|
|
10205
10207
|
type: [
|
|
@@ -10264,7 +10266,7 @@ function setupCommands(argv) {
|
|
|
10264
10266
|
}
|
|
10265
10267
|
function showGreeting() {
|
|
10266
10268
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
10267
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.0
|
|
10269
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.0\n`);
|
|
10268
10270
|
}
|
|
10269
10271
|
function setupLogLevel(argv) {
|
|
10270
10272
|
if (argv.length <= 3) return;
|
|
@@ -10286,5 +10288,5 @@ function runCLI({ argv = process.argv } = {}) {
|
|
|
10286
10288
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
10287
10289
|
}
|
|
10288
10290
|
}
|
|
10289
|
-
let src_version = "2.2.0
|
|
10291
|
+
let src_version = "2.2.0";
|
|
10290
10292
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, 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 };
|
package/dist/manifest-plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__webpack_require__ as e}from"./rslib-runtime.js";import"./626.js";e.add({"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");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,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.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,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},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)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={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};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.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,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/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 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){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 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){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 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 m=(e,t)=>t;class d{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:m},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 y(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 y{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 k{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 k(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:()=>d,MultiHook:()=>k,QueriedHook:()=>i,QueriedHookMap:()=>y,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})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-rc.0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
|
|
1
|
+
import{__webpack_require__ as e}from"./rslib-runtime.js";import"./626.js";e.add({"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");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,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.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,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},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)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={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};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.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,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/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 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){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 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){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 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 m=(e,t)=>t;class d{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:m},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 y(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 y{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 k{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 k(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:()=>d,MultiHook:()=>k,QueriedHook:()=>i,QueriedHookMap:()=>y,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})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
|
|
@@ -14,7 +14,6 @@ export type AssetsMiddleware = RequestHandler & {
|
|
|
14
14
|
watch: () => void;
|
|
15
15
|
close: AssetsMiddlewareClose;
|
|
16
16
|
};
|
|
17
|
-
export declare const isClientCompiler: (compiler: Compiler) => boolean;
|
|
18
17
|
export declare const setupServerHooks: ({ context, compiler, token, socketServer, liveReload }: {
|
|
19
18
|
context: InternalContext;
|
|
20
19
|
compiler: Compiler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"types.d.ts"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@rspack/core": "2.2.0
|
|
38
|
+
"@rspack/core": "2.2.0",
|
|
39
39
|
"@swc/helpers": "^0.5.23"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|