@rsbuild/core 2.1.6 → 2.1.8
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/cors/index.d.ts +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.d.ts +1 -1
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/postcss.d.ts +4 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +7 -0
- package/compiled/rslog/package.json +1 -1
- package/dist/{711.js → 626.js} +336 -252
- package/dist/build.d.ts +4 -0
- package/dist/chokidar.js +1 -1046
- package/{dist-types → dist}/cli/commands.d.ts +2 -2
- package/{dist-types → dist}/cli/init.d.ts +3 -4
- package/dist/client/hmr.js +1 -1
- package/dist/client/overlay.js +1 -1
- package/{dist-types → dist}/configChain.d.ts +2 -2
- package/dist/connect-next.js +1 -876
- package/dist/cors.js +1 -1
- package/{dist-types → dist}/createCompiler.d.ts +2 -2
- package/{dist-types → dist}/createContext.d.ts +4 -3
- package/{dist-types → dist}/createRsbuild.d.ts +1 -1
- package/{dist-types → dist}/defaultConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/compiler.d.ts +1 -1
- package/{dist-types → dist}/helpers/css.d.ts +1 -1
- package/{dist-types → dist}/helpers/format.d.ts +1 -1
- package/{dist-types → dist}/helpers/fs.d.ts +2 -2
- package/{dist-types → dist}/helpers/index.d.ts +4 -4
- package/{dist-types → dist}/helpers/overlayConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/path.d.ts +1 -1
- package/dist/helpers/restartManager.d.ts +13 -0
- package/{dist-types → dist}/helpers/stats.d.ts +2 -2
- package/{dist-types → dist}/helpers/url.d.ts +2 -2
- package/{dist-types → dist}/helpers/vendors.d.ts +1 -1
- package/{dist-types → dist}/hooks.d.ts +2 -1
- package/dist/http-proxy-middleware.js +5 -3010
- package/{dist-types → dist}/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/{dist-types → dist}/initConfigs.d.ts +1 -1
- package/{dist-types → dist}/initPlugins.d.ts +2 -2
- package/{dist-types → dist}/inspectConfig.d.ts +2 -2
- package/dist/launch-editor-middleware.js +1 -544
- package/{dist-types → dist}/loadConfig.d.ts +6 -6
- package/{dist-types → dist}/loader/cssUrlLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/ignoreCssLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformRawLoader.d.ts +1 -1
- package/{dist-types → dist}/logger.d.ts +1 -1
- package/dist/manifest-plugin.js +1 -692
- package/dist/memfs.js +1 -5695
- package/{dist-types → dist}/mergeConfig.d.ts +1 -1
- package/dist/open.js +2 -439
- package/{dist-types → dist}/pluginHelper.d.ts +1 -1
- package/{dist-types → dist}/pluginManager.d.ts +2 -2
- package/{dist-types → dist}/plugins/appIcon.d.ts +1 -1
- package/{dist-types → dist}/plugins/asset.d.ts +1 -1
- package/{dist-types → dist}/plugins/basic.d.ts +1 -1
- package/dist/plugins/cache.d.ts +2 -0
- package/{dist-types → dist}/plugins/cleanOutput.d.ts +1 -1
- package/{dist-types → dist}/plugins/css.d.ts +1 -1
- package/{dist-types → dist}/plugins/define.d.ts +1 -1
- package/dist/plugins/entry.d.ts +2 -0
- package/{dist-types → dist}/plugins/externals.d.ts +2 -2
- package/{dist-types → dist}/plugins/fileSize.d.ts +1 -1
- package/{dist-types → dist}/plugins/html.d.ts +1 -1
- package/{dist-types → dist}/plugins/inlineChunk.d.ts +1 -1
- package/{dist-types → dist}/plugins/lazyCompilation.d.ts +1 -1
- package/{dist-types → dist}/plugins/manifest.d.ts +1 -1
- package/{dist-types → dist}/plugins/minimize.d.ts +3 -3
- package/{dist-types → dist}/plugins/moduleFederation.d.ts +1 -1
- package/{dist-types → dist}/plugins/nodeAddons.d.ts +1 -1
- package/dist/plugins/nonce.d.ts +2 -0
- package/{dist-types → dist}/plugins/output.d.ts +1 -1
- package/{dist-types → dist}/plugins/progress.d.ts +1 -1
- package/{dist-types → dist}/plugins/resolve.d.ts +1 -1
- package/{dist-types → dist}/plugins/resourceHints.d.ts +1 -1
- package/{dist-types → dist}/plugins/rsdoctor.d.ts +1 -1
- package/{dist-types → dist}/plugins/rspackProfile.d.ts +1 -1
- package/{dist-types → dist}/plugins/server.d.ts +1 -1
- package/{dist-types → dist}/plugins/sourceMap.d.ts +1 -1
- package/{dist-types → dist}/plugins/splitChunks.d.ts +1 -1
- package/dist/plugins/sri.d.ts +2 -0
- package/{dist-types → dist}/plugins/swc.d.ts +1 -1
- package/{dist-types → dist}/plugins/target.d.ts +1 -1
- package/dist/plugins/wasm.d.ts +2 -0
- package/{dist-types → dist}/plugins/worker.d.ts +1 -1
- package/dist/range-parser.js +1 -1
- package/dist/restart.d.ts +15 -0
- package/{dist-types → dist}/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/extractChunks.d.ts +1 -1
- package/{dist-types → dist}/rspackConfig.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/getFileFromUrl.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/index.d.ts +2 -2
- package/{dist-types → dist}/server/assets-middleware/middleware.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupWriteToDisk.d.ts +2 -2
- package/{dist-types → dist}/server/browserLogs.d.ts +1 -1
- package/{dist-types → dist}/server/buildManager.d.ts +3 -3
- package/{dist-types → dist}/server/cliShortcuts.d.ts +2 -2
- package/{dist-types → dist}/server/devMiddlewares.d.ts +4 -4
- package/{dist-types → dist}/server/devServer.d.ts +4 -4
- package/{dist-types → dist}/server/environment.d.ts +1 -1
- package/{dist-types → dist}/server/gzipMiddleware.d.ts +1 -1
- package/{dist-types → dist}/server/helper.d.ts +4 -4
- package/{dist-types → dist}/server/historyApiFallback.d.ts +2 -2
- package/{dist-types → dist}/server/httpServer.d.ts +1 -1
- package/{dist-types → dist}/server/middlewares.d.ts +2 -2
- package/{dist-types → dist}/server/open.d.ts +2 -2
- package/{dist-types → dist}/server/previewServer.d.ts +2 -2
- package/{dist-types → dist}/server/proxy.d.ts +3 -3
- package/{dist-types → dist}/server/runner/basic.d.ts +1 -1
- package/{dist-types → dist}/server/runner/cjs.d.ts +2 -2
- package/{dist-types → dist}/server/runner/esm.d.ts +2 -2
- package/{dist-types → dist}/server/runner/index.d.ts +1 -1
- package/{dist-types → dist}/server/serverSetup.d.ts +1 -1
- package/{dist-types → dist}/server/socketServer.d.ts +1 -1
- package/{dist-types → dist}/server/watchFiles.d.ts +4 -3
- package/dist/sirv.js +1 -1
- package/dist/tinyglobby.js +1 -1670
- package/{dist-types → dist}/types/config.d.ts +36 -19
- package/{dist-types → dist}/types/context.d.ts +11 -7
- package/{dist-types → dist}/types/hooks.d.ts +36 -9
- package/dist/types/index.d.ts +8 -0
- package/{dist-types → dist}/types/plugin.d.ts +10 -7
- package/{dist-types → dist}/types/rsbuild.d.ts +21 -14
- package/{dist-types → dist}/types/rspack.d.ts +2 -2
- package/{dist-types → dist}/types/thirdParty.d.ts +5 -5
- package/dist/ws.js +2 -1528
- package/package.json +11 -12
- package/dist-types/build.d.ts +0 -4
- package/dist-types/package.json +0 -1
- package/dist-types/plugins/cache.d.ts +0 -2
- package/dist-types/plugins/entry.d.ts +0 -2
- package/dist-types/plugins/nonce.d.ts +0 -2
- package/dist-types/plugins/sri.d.ts +0 -2
- package/dist-types/plugins/wasm.d.ts +0 -2
- package/dist-types/restart.d.ts +0 -19
- package/dist-types/types/index.d.ts +0 -8
- /package/dist/{711.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
- /package/{dist-types → dist}/cli/index.d.ts +0 -0
- /package/dist/client/{307.js → 307~0.js} +0 -0
- /package/{dist-types → dist}/constants.d.ts +0 -0
- /package/{dist-types → dist}/helpers/exitHook.d.ts +0 -0
- /package/{dist-types → dist}/helpers/packageJson.d.ts +0 -0
- /package/{dist-types → dist}/helpers/version.d.ts +0 -0
- /package/{dist-types → dist}/loadEnv.d.ts +0 -0
- /package/{dist-types → dist}/loader/workerLoader.d.ts +0 -0
- /package/dist/{1~rslib-runtime.js → rslib-runtime.js} +0 -0
- /package/{dist-types → dist}/rspack-plugins/resource-hints/getResourceType.d.ts +0 -0
- /package/{dist-types → dist}/server/ansiHTML.d.ts +0 -0
- /package/{dist-types → dist}/server/assets-middleware/parseTokenList.d.ts +0 -0
- /package/{dist-types → dist}/server/compileState.d.ts +0 -0
- /package/{dist-types → dist}/server/gracefulShutdown.d.ts +0 -0
- /package/{dist-types → dist}/server/hmrFallback.d.ts +0 -0
- /package/{dist-types → dist}/server/overlay.d.ts +0 -0
- /package/{dist-types → dist}/server/publicPathnames.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/asModule.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/type.d.ts +0 -0
- /package/{dist-types → dist}/types/utils.d.ts +0 -0
package/dist/manifest-plugin.js
CHANGED
|
@@ -1,692 +1 @@
|
|
|
1
|
-
import { __webpack_require__ } from "./1~rslib-runtime.js";
|
|
2
|
-
import "./711.js";
|
|
3
|
-
__webpack_require__.add({
|
|
4
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5
|
-
exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
|
|
6
|
-
let node_path_1 = __webpack_require__("node:path?435f");
|
|
7
|
-
exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
|
|
8
|
-
[name]: entrypoint.getFiles()
|
|
9
|
-
}), {}), {
|
|
10
|
-
compilation
|
|
11
|
-
}) : files.reduce((manifest, file)=>Object.assign(manifest, {
|
|
12
|
-
[file.name]: file.path
|
|
13
|
-
}), seed), exports.reduceAssets = (files, asset, moduleAssets)=>{
|
|
14
|
-
let name;
|
|
15
|
-
return (moduleAssets[asset.name] ? name = moduleAssets[asset.name] : asset.info.sourceFilename && (name = (0, node_path_1.join)((0, node_path_1.dirname)(asset.name), (0, node_path_1.basename)(asset.info.sourceFilename))), name) ? files.concat({
|
|
16
|
-
isAsset: !0,
|
|
17
|
-
isChunk: !1,
|
|
18
|
-
isInitial: !1,
|
|
19
|
-
isModuleAsset: !0,
|
|
20
|
-
name,
|
|
21
|
-
path: asset.name
|
|
22
|
-
}) : asset.chunks && asset.chunks.length > 0 ? files : files.concat({
|
|
23
|
-
isAsset: !0,
|
|
24
|
-
isChunk: !1,
|
|
25
|
-
isInitial: !1,
|
|
26
|
-
isModuleAsset: !1,
|
|
27
|
-
name: asset.name,
|
|
28
|
-
path: asset.name
|
|
29
|
-
});
|
|
30
|
-
}, exports.reduceChunk = (files, chunk, options, auxiliaryFiles)=>(Array.from(chunk.auxiliaryFiles || []).forEach((auxiliaryFile)=>{
|
|
31
|
-
auxiliaryFiles[auxiliaryFile] = {
|
|
32
|
-
isAsset: !0,
|
|
33
|
-
isChunk: !1,
|
|
34
|
-
isInitial: !1,
|
|
35
|
-
isModuleAsset: !0,
|
|
36
|
-
name: (0, node_path_1.basename)(auxiliaryFile),
|
|
37
|
-
path: auxiliaryFile
|
|
38
|
-
};
|
|
39
|
-
}), Array.from(chunk.files).reduce((prev, path)=>{
|
|
40
|
-
let name = chunk.name ? chunk.name : null;
|
|
41
|
-
return name = name ? options.useEntryKeys && !path.endsWith('.map') ? name : `${name}.${((fileName, { transformExtensions })=>{
|
|
42
|
-
let split = fileName.replace(/\?.*/, '').split('.'), extension = split.pop();
|
|
43
|
-
return transformExtensions.test(extension) ? `${split.pop()}.${extension}` : extension;
|
|
44
|
-
})(path, options)}` : path, prev.concat({
|
|
45
|
-
chunk,
|
|
46
|
-
isAsset: !1,
|
|
47
|
-
isChunk: !0,
|
|
48
|
-
isInitial: chunk.isOnlyInitial(),
|
|
49
|
-
isModuleAsset: !1,
|
|
50
|
-
name,
|
|
51
|
-
path
|
|
52
|
-
});
|
|
53
|
-
}, files));
|
|
54
|
-
let standardizeFilePaths = (file)=>{
|
|
55
|
-
let result = Object.assign({}, file);
|
|
56
|
-
return result.name = file.name.replace(/\\/g, '/'), result.path = file.path.replace(/\\/g, '/'), result;
|
|
57
|
-
};
|
|
58
|
-
exports.transformFiles = (files, options)=>[
|
|
59
|
-
'filter',
|
|
60
|
-
'map',
|
|
61
|
-
'sort'
|
|
62
|
-
].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
|
|
63
|
-
},
|
|
64
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
65
|
-
exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
|
|
66
|
-
let node_fs_1 = __webpack_require__("node:fs?9592"), node_path_1 = __webpack_require__("node:path?435f"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
|
|
67
|
-
let hooks = compilerHookMap.get(compiler);
|
|
68
|
-
return void 0 === hooks && (hooks = {
|
|
69
|
-
afterEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
70
|
-
'manifest'
|
|
71
|
-
]),
|
|
72
|
-
beforeEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
73
|
-
'manifest'
|
|
74
|
-
])
|
|
75
|
-
}, compilerHookMap.set(compiler, hooks)), hooks;
|
|
76
|
-
};
|
|
77
|
-
exports.getCompilerHooks = getCompilerHooks, exports.beforeRunHook = ({ emitCountMap, manifestFileName }, _, callback)=>{
|
|
78
|
-
let emitCount = emitCountMap.get(manifestFileName) || 0;
|
|
79
|
-
emitCountMap.set(manifestFileName, emitCount + 1), callback && callback();
|
|
80
|
-
}, exports.emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manifestFileName, moduleAssets, options }, compilation) {
|
|
81
|
-
let emitCount = emitCountMap.get(manifestFileName) - 1, stats = compilation.getStats().toJson({
|
|
82
|
-
all: !1,
|
|
83
|
-
assets: !0,
|
|
84
|
-
cachedAssets: !0,
|
|
85
|
-
ids: !0,
|
|
86
|
-
publicPath: !0
|
|
87
|
-
}), resolvedPublicPath = null !== options.publicPath ? options.publicPath : stats.publicPath, publicPath = 'auto' === resolvedPublicPath ? '' : resolvedPublicPath, { basePath, removeKeyHash } = options;
|
|
88
|
-
emitCountMap.set(manifestFileName, emitCount);
|
|
89
|
-
let auxiliaryFiles = {}, files = Array.from(compilation.chunks).reduce((prev, chunk)=>(0, helpers_1.reduceChunk)(prev, chunk, options, auxiliaryFiles), []);
|
|
90
|
-
(files = (files = stats.assets.reduce((prev, asset)=>(0, helpers_1.reduceAssets)(prev, asset, moduleAssets), files)).filter(({ name, path })=>!path.includes('hot-update') && void 0 === emitCountMap.get((0, node_path_1.join)(compiler.options.output?.path || '<unknown>', name)))).forEach((file)=>{
|
|
91
|
-
delete auxiliaryFiles[file.path];
|
|
92
|
-
}), Object.keys(auxiliaryFiles).forEach((auxiliaryFile)=>{
|
|
93
|
-
files = files.concat(auxiliaryFiles[auxiliaryFile]);
|
|
94
|
-
});
|
|
95
|
-
let integrityMap = {};
|
|
96
|
-
stats.assets?.forEach((asset)=>{
|
|
97
|
-
asset.integrity && (integrityMap[asset.name] = asset.integrity);
|
|
98
|
-
}), files = files.map((file)=>{
|
|
99
|
-
let normalizePath = (path)=>path.endsWith('/') ? path : `${path}/`, changes = {
|
|
100
|
-
name: basePath ? normalizePath(basePath) + file.name : file.name,
|
|
101
|
-
path: publicPath ? normalizePath(publicPath) + file.path : file.path
|
|
102
|
-
};
|
|
103
|
-
return integrityMap[file.path] && (changes.integrity = integrityMap[file.path]), changes.name = removeKeyHash ? changes.name.replace(removeKeyHash, '') : changes.name, Object.assign(file, changes);
|
|
104
|
-
}), files = (0, helpers_1.transformFiles)(files, options);
|
|
105
|
-
let manifest = (0, helpers_1.generateManifest)(compilation, files, options), isLastEmit = 0 === emitCount;
|
|
106
|
-
if (manifest = getCompilerHooks(compiler).beforeEmit.call(manifest), isLastEmit) {
|
|
107
|
-
let output = options.serialize(manifest);
|
|
108
|
-
compilation.emitAsset(manifestAssetId, new compiler.webpack.sources.RawSource(output)), options.writeToFileEmit && ((0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(manifestFileName), {
|
|
109
|
-
recursive: !0
|
|
110
|
-
}), (0, node_fs_1.writeFileSync)(manifestFileName, output));
|
|
111
|
-
}
|
|
112
|
-
getCompilerHooks(compiler).afterEmit.call(manifest);
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
116
|
-
exports.RspackManifestPlugin = void 0;
|
|
117
|
-
let node_path_1 = __webpack_require__("node:path?435f"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
|
|
118
|
-
assetHookStage: 1 / 0,
|
|
119
|
-
basePath: '',
|
|
120
|
-
fileName: 'manifest.json',
|
|
121
|
-
filter: null,
|
|
122
|
-
generate: void 0,
|
|
123
|
-
map: null,
|
|
124
|
-
publicPath: null,
|
|
125
|
-
removeKeyHash: /([a-f0-9]{16,32}\.?)/gi,
|
|
126
|
-
seed: void 0,
|
|
127
|
-
serialize: (manifest)=>JSON.stringify(manifest, null, 2),
|
|
128
|
-
sort: null,
|
|
129
|
-
transformExtensions: /^(gz|map)$/i,
|
|
130
|
-
useEntryKeys: !1,
|
|
131
|
-
useLegacyEmit: !1,
|
|
132
|
-
writeToFileEmit: !1
|
|
133
|
-
};
|
|
134
|
-
exports.RspackManifestPlugin = class {
|
|
135
|
-
options;
|
|
136
|
-
constructor(opts){
|
|
137
|
-
this.options = Object.assign({}, defaults, opts);
|
|
138
|
-
}
|
|
139
|
-
apply(compiler) {
|
|
140
|
-
let manifestFileName = (0, node_path_1.resolve)(compiler.options.output?.path || './', this.options.fileName), manifestAssetId = (0, node_path_1.relative)(compiler.options.output?.path || './', manifestFileName), beforeRun = hooks_1.beforeRunHook.bind(this, {
|
|
141
|
-
emitCountMap,
|
|
142
|
-
manifestFileName
|
|
143
|
-
}), emit = hooks_1.emitHook.bind(this, {
|
|
144
|
-
compiler,
|
|
145
|
-
emitCountMap,
|
|
146
|
-
manifestAssetId,
|
|
147
|
-
manifestFileName,
|
|
148
|
-
moduleAssets: {},
|
|
149
|
-
options: this.options
|
|
150
|
-
}), hookOptions = {
|
|
151
|
-
name: 'WebpackManifestPlugin',
|
|
152
|
-
stage: this.options.assetHookStage
|
|
153
|
-
};
|
|
154
|
-
!0 === this.options.useLegacyEmit ? compiler.hooks.emit.tap(hookOptions, emit) : compiler.hooks.thisCompilation.tap(hookOptions, (compilation)=>{
|
|
155
|
-
compilation.hooks.processAssets.tap(hookOptions, ()=>emit(compilation));
|
|
156
|
-
}), compiler.hooks.run.tapAsync(hookOptions, beforeRun), compiler.hooks.watchRun.tapAsync(hookOptions, beforeRun);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs" (__unused_rspack_module, exports) {
|
|
161
|
-
var __nested_rspack_require_18_37__ = {};
|
|
162
|
-
__nested_rspack_require_18_37__.d = (exports1, getters, values)=>{
|
|
163
|
-
var define = (defs, kind)=>{
|
|
164
|
-
for(var key in defs)__nested_rspack_require_18_37__.o(defs, key) && !__nested_rspack_require_18_37__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
165
|
-
enumerable: !0,
|
|
166
|
-
[kind]: defs[key]
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
define(getters, "get"), define(values, "value");
|
|
170
|
-
}, __nested_rspack_require_18_37__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __nested_rspack_require_18_37__.r = (exports1)=>{
|
|
171
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
172
|
-
value: 'Module'
|
|
173
|
-
}), Object.defineProperty(exports1, '__esModule', {
|
|
174
|
-
value: !0
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
var __nested_rspack_exports__ = {};
|
|
178
|
-
function _define_property(obj, key, value) {
|
|
179
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
180
|
-
value: value,
|
|
181
|
-
enumerable: !0,
|
|
182
|
-
configurable: !0,
|
|
183
|
-
writable: !0
|
|
184
|
-
}) : obj[key] = value, obj;
|
|
185
|
-
}
|
|
186
|
-
__nested_rspack_require_18_37__.r(__nested_rspack_exports__);
|
|
187
|
-
class HookBase {
|
|
188
|
-
intercept(interceptor) {
|
|
189
|
-
if (this.interceptors.push(Object.assign({}, interceptor)), interceptor.register) for(let i = 0; i < this.taps.length; i++)this.taps[i] = interceptor.register(this.taps[i]);
|
|
190
|
-
}
|
|
191
|
-
_runRegisterInterceptors(options) {
|
|
192
|
-
return this.interceptors.reduce((options, interceptor)=>interceptor.register?.(options) ?? options, options);
|
|
193
|
-
}
|
|
194
|
-
_runCallInterceptors(...args) {
|
|
195
|
-
for (let interceptor of this.interceptors)interceptor.call && interceptor.call(...args);
|
|
196
|
-
}
|
|
197
|
-
_runErrorInterceptors(e) {
|
|
198
|
-
for (let interceptor of this.interceptors)interceptor.error && interceptor.error(e);
|
|
199
|
-
}
|
|
200
|
-
_runTapInterceptors(tap) {
|
|
201
|
-
for (let interceptor of this.interceptors)interceptor.tap && interceptor.tap(tap);
|
|
202
|
-
}
|
|
203
|
-
_runDoneInterceptors() {
|
|
204
|
-
for (let interceptor of this.interceptors)interceptor.done && interceptor.done();
|
|
205
|
-
}
|
|
206
|
-
_runResultInterceptors(r) {
|
|
207
|
-
for (let interceptor of this.interceptors)interceptor.result && interceptor.result(r);
|
|
208
|
-
}
|
|
209
|
-
withOptions(options) {
|
|
210
|
-
let mergeOptions = (opt)=>Object.assign({}, options, 'string' == typeof opt ? {
|
|
211
|
-
name: opt
|
|
212
|
-
} : opt);
|
|
213
|
-
return {
|
|
214
|
-
name: this.name,
|
|
215
|
-
tap: (opt, fn)=>this.tap(mergeOptions(opt), fn),
|
|
216
|
-
tapAsync: (opt, fn)=>this.tapAsync(mergeOptions(opt), fn),
|
|
217
|
-
tapPromise: (opt, fn)=>this.tapPromise(mergeOptions(opt), fn),
|
|
218
|
-
intercept: (interceptor)=>this.intercept(interceptor),
|
|
219
|
-
isUsed: ()=>this.isUsed(),
|
|
220
|
-
withOptions: (opt)=>this.withOptions(mergeOptions(opt)),
|
|
221
|
-
queryStageRange: (stageRange)=>this.queryStageRange(stageRange)
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
isUsed() {
|
|
225
|
-
return this.taps.length > 0 || this.interceptors.length > 0;
|
|
226
|
-
}
|
|
227
|
-
queryStageRange(stageRange) {
|
|
228
|
-
return new QueriedHook(stageRange, this);
|
|
229
|
-
}
|
|
230
|
-
callAsyncStageRange(_queried) {
|
|
231
|
-
throw Error('Hook should implement there own _callAsyncStageRange');
|
|
232
|
-
}
|
|
233
|
-
callAsync(...args) {
|
|
234
|
-
return this.callAsyncStageRange(this.queryStageRange(allStageRange), ...args);
|
|
235
|
-
}
|
|
236
|
-
promiseStageRange(queried, ...args) {
|
|
237
|
-
return new Promise((resolve, reject)=>{
|
|
238
|
-
this.callAsyncStageRange(queried, ...args, (e, r)=>e ? reject(e) : resolve(r));
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
promise(...args) {
|
|
242
|
-
return this.promiseStageRange(this.queryStageRange(allStageRange), ...args);
|
|
243
|
-
}
|
|
244
|
-
tap(options, fn) {
|
|
245
|
-
this._tap('sync', options, fn);
|
|
246
|
-
}
|
|
247
|
-
tapAsync(options, fn) {
|
|
248
|
-
this._tap('async', options, fn);
|
|
249
|
-
}
|
|
250
|
-
tapPromise(options, fn) {
|
|
251
|
-
this._tap('promise', options, fn);
|
|
252
|
-
}
|
|
253
|
-
_tap(type, options, fn) {
|
|
254
|
-
let normalizedOptions = options;
|
|
255
|
-
if ('string' == typeof options) normalizedOptions = {
|
|
256
|
-
name: options.trim()
|
|
257
|
-
};
|
|
258
|
-
else if ('object' != typeof options || null === options) throw Error('Invalid tap options');
|
|
259
|
-
if ('string' != typeof normalizedOptions.name || '' === normalizedOptions.name) throw Error('Missing name for tap');
|
|
260
|
-
this._insert(this._runRegisterInterceptors(Object.assign({
|
|
261
|
-
type,
|
|
262
|
-
fn
|
|
263
|
-
}, normalizedOptions)));
|
|
264
|
-
}
|
|
265
|
-
_insert(item) {
|
|
266
|
-
let before;
|
|
267
|
-
'string' == typeof item.before ? before = new Set([
|
|
268
|
-
item.before
|
|
269
|
-
]) : Array.isArray(item.before) && (before = new Set(item.before));
|
|
270
|
-
let stage = 0;
|
|
271
|
-
'number' == typeof item.stage && (stage = item.stage);
|
|
272
|
-
let i = this.taps.length;
|
|
273
|
-
for(; i > 0;){
|
|
274
|
-
i--;
|
|
275
|
-
let x = this.taps[i];
|
|
276
|
-
this.taps[i + 1] = x;
|
|
277
|
-
let xStage = x.stage || 0;
|
|
278
|
-
if (before) {
|
|
279
|
-
if (before.has(x.name)) {
|
|
280
|
-
before.delete(x.name);
|
|
281
|
-
continue;
|
|
282
|
-
}
|
|
283
|
-
if (before.size > 0) continue;
|
|
284
|
-
}
|
|
285
|
-
if (!(xStage > stage)) {
|
|
286
|
-
i++;
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
this.taps[i] = item;
|
|
291
|
-
}
|
|
292
|
-
_prepareArgs(args) {
|
|
293
|
-
let len = this.args.length;
|
|
294
|
-
return args.length < len ? (args.length = len, args.fill(void 0, args.length, len)) : (args.length > len && (args.length = len), args);
|
|
295
|
-
}
|
|
296
|
-
constructor(args = [], name){
|
|
297
|
-
_define_property(this, "args", void 0), _define_property(this, "name", void 0), _define_property(this, "taps", void 0), _define_property(this, "interceptors", void 0), this.args = args, this.name = name, this.taps = [], this.interceptors = [];
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
let minStage = -1 / 0, maxStage = 1 / 0, allStageRange = [
|
|
301
|
-
minStage,
|
|
302
|
-
1 / 0
|
|
303
|
-
], i32MAX = 2147483648 - 1;
|
|
304
|
-
class QueriedHook {
|
|
305
|
-
isUsed() {
|
|
306
|
-
return !!(this.tapsInRange.length > 0 || this.stageRange[0] === minStage && this.hook.interceptors.some((i)=>i.call) || this.stageRange[1] === maxStage && this.hook.interceptors.some((i)=>i.done));
|
|
307
|
-
}
|
|
308
|
-
call(...args) {
|
|
309
|
-
if ('function' != typeof this.hook.callStageRange) throw Error('hook is not a SyncHook, call methods only exists on SyncHook');
|
|
310
|
-
return this.hook.callStageRange(this, ...args);
|
|
311
|
-
}
|
|
312
|
-
callAsync(...args) {
|
|
313
|
-
return this.hook.callAsyncStageRange(this, ...args);
|
|
314
|
-
}
|
|
315
|
-
promise(...args) {
|
|
316
|
-
return this.hook.promiseStageRange(this, ...args);
|
|
317
|
-
}
|
|
318
|
-
constructor(stageRange, hook){
|
|
319
|
-
_define_property(this, "stageRange", void 0), _define_property(this, "hook", void 0), _define_property(this, "tapsInRange", void 0);
|
|
320
|
-
let tapsInRange = [], [from, to] = stageRange;
|
|
321
|
-
for (let tap of hook.taps){
|
|
322
|
-
let stage = tap.stage ?? 0;
|
|
323
|
-
from <= stage && stage < to ? tapsInRange.push(tap) : to === maxStage && stage === maxStage && tapsInRange.push(tap);
|
|
324
|
-
}
|
|
325
|
-
this.stageRange = stageRange, this.hook = hook, this.tapsInRange = tapsInRange;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
class SyncHook extends HookBase {
|
|
329
|
-
callAsyncStageRange(queried, ...args) {
|
|
330
|
-
let { stageRange: [from, to], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
331
|
-
for (let tap of (from === minStage && this._runCallInterceptors(...args2), tapsInRange)){
|
|
332
|
-
this._runTapInterceptors(tap);
|
|
333
|
-
try {
|
|
334
|
-
tap.fn(...args2);
|
|
335
|
-
} catch (e) {
|
|
336
|
-
return this._runErrorInterceptors(e), cb(e);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
to === maxStage && (this._runDoneInterceptors(), cb(null));
|
|
340
|
-
}
|
|
341
|
-
call(...args) {
|
|
342
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
343
|
-
}
|
|
344
|
-
callStageRange(queried, ...args) {
|
|
345
|
-
let result, error;
|
|
346
|
-
if (this.callAsyncStageRange(queried, ...args, (e, r)=>{
|
|
347
|
-
error = e, result = r;
|
|
348
|
-
}), error) throw error;
|
|
349
|
-
return result;
|
|
350
|
-
}
|
|
351
|
-
tapAsync() {
|
|
352
|
-
throw Error('tapAsync is not supported on a SyncHook');
|
|
353
|
-
}
|
|
354
|
-
tapPromise() {
|
|
355
|
-
throw Error('tapPromise is not supported on a SyncHook');
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
class SyncBailHook extends HookBase {
|
|
359
|
-
callAsyncStageRange(queried, ...args) {
|
|
360
|
-
let { stageRange: [from, to], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
361
|
-
for (let tap of (from === minStage && this._runCallInterceptors(...args2), tapsInRange)){
|
|
362
|
-
let r;
|
|
363
|
-
this._runTapInterceptors(tap);
|
|
364
|
-
try {
|
|
365
|
-
r = tap.fn(...args2);
|
|
366
|
-
} catch (e) {
|
|
367
|
-
return this._runErrorInterceptors(e), cb(e);
|
|
368
|
-
}
|
|
369
|
-
if (void 0 !== r) return this._runResultInterceptors(r), cb(null, r);
|
|
370
|
-
}
|
|
371
|
-
to === maxStage && (this._runDoneInterceptors(), cb(null));
|
|
372
|
-
}
|
|
373
|
-
call(...args) {
|
|
374
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
375
|
-
}
|
|
376
|
-
callStageRange(queried, ...args) {
|
|
377
|
-
let result, error;
|
|
378
|
-
if (this.callAsyncStageRange(queried, ...args, (e, r)=>{
|
|
379
|
-
error = e, result = r;
|
|
380
|
-
}), error) throw error;
|
|
381
|
-
return result;
|
|
382
|
-
}
|
|
383
|
-
tapAsync() {
|
|
384
|
-
throw Error('tapAsync is not supported on a SyncBailHook');
|
|
385
|
-
}
|
|
386
|
-
tapPromise() {
|
|
387
|
-
throw Error('tapPromise is not supported on a SyncBailHook');
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
class SyncWaterfallHook extends HookBase {
|
|
391
|
-
callAsyncStageRange(queried, ...args) {
|
|
392
|
-
let { stageRange: [from, to], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
393
|
-
for (let tap of (from === minStage && this._runCallInterceptors(...args2), tapsInRange)){
|
|
394
|
-
this._runTapInterceptors(tap);
|
|
395
|
-
try {
|
|
396
|
-
let r = tap.fn(...args2);
|
|
397
|
-
void 0 !== r && (args2[0] = r);
|
|
398
|
-
} catch (e) {
|
|
399
|
-
return this._runErrorInterceptors(e), cb(e);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
to === maxStage && (this._runDoneInterceptors(), cb(null, args2[0]));
|
|
403
|
-
}
|
|
404
|
-
call(...args) {
|
|
405
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
406
|
-
}
|
|
407
|
-
callStageRange(queried, ...args) {
|
|
408
|
-
let result, error;
|
|
409
|
-
if (this.callAsyncStageRange(queried, ...args, (e, r)=>{
|
|
410
|
-
error = e, result = r;
|
|
411
|
-
}), error) throw error;
|
|
412
|
-
return result;
|
|
413
|
-
}
|
|
414
|
-
tapAsync() {
|
|
415
|
-
throw Error('tapAsync is not supported on a SyncWaterfallHook');
|
|
416
|
-
}
|
|
417
|
-
tapPromise() {
|
|
418
|
-
throw Error('tapPromise is not supported on a SyncWaterfallHook');
|
|
419
|
-
}
|
|
420
|
-
constructor(args = [], name){
|
|
421
|
-
if (args.length < 1) throw Error('Waterfall hooks must have at least one argument');
|
|
422
|
-
super(args, name);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
class AsyncParallelHook extends HookBase {
|
|
426
|
-
callAsyncStageRange(queried, ...args) {
|
|
427
|
-
let { stageRange: [from], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
428
|
-
from === minStage && this._runCallInterceptors(...args2);
|
|
429
|
-
let done = ()=>{
|
|
430
|
-
this._runDoneInterceptors(), cb(null);
|
|
431
|
-
}, error = (e)=>{
|
|
432
|
-
this._runErrorInterceptors(e), cb(e);
|
|
433
|
-
};
|
|
434
|
-
if (0 === tapsInRange.length) return done();
|
|
435
|
-
let counter = tapsInRange.length;
|
|
436
|
-
for (let tap of tapsInRange){
|
|
437
|
-
if (this._runTapInterceptors(tap), 'promise' === tap.type) {
|
|
438
|
-
let promise = tap.fn(...args2);
|
|
439
|
-
if (!promise || !promise.then) throw Error(`Tap function (tapPromise) did not return promise (returned ${promise})`);
|
|
440
|
-
promise.then(()=>{
|
|
441
|
-
0 == (counter -= 1) && done();
|
|
442
|
-
}, (e)=>{
|
|
443
|
-
counter = 0, error(e);
|
|
444
|
-
});
|
|
445
|
-
} else if ('async' === tap.type) tap.fn(...args2, (e)=>{
|
|
446
|
-
e ? (counter = 0, error(e)) : 0 == (counter -= 1) && done();
|
|
447
|
-
});
|
|
448
|
-
else {
|
|
449
|
-
let hasError = !1;
|
|
450
|
-
try {
|
|
451
|
-
tap.fn(...args2);
|
|
452
|
-
} catch (e) {
|
|
453
|
-
hasError = !0, counter = 0, error(e);
|
|
454
|
-
}
|
|
455
|
-
hasError || 0 != --counter || done();
|
|
456
|
-
}
|
|
457
|
-
if (counter <= 0) return;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
class AsyncSeriesHook extends HookBase {
|
|
462
|
-
callAsyncStageRange(queried, ...args) {
|
|
463
|
-
let { stageRange: [from], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
464
|
-
from === minStage && this._runCallInterceptors(...args2);
|
|
465
|
-
let done = ()=>{
|
|
466
|
-
this._runDoneInterceptors(), cb(null);
|
|
467
|
-
}, error = (e)=>{
|
|
468
|
-
this._runErrorInterceptors(e), cb(e);
|
|
469
|
-
};
|
|
470
|
-
if (0 === tapsInRange.length) return done();
|
|
471
|
-
let index = 0, next = ()=>{
|
|
472
|
-
let tap = tapsInRange[index];
|
|
473
|
-
if (this._runTapInterceptors(tap), 'promise' === tap.type) {
|
|
474
|
-
let promise = tap.fn(...args2);
|
|
475
|
-
if (!promise || !promise.then) throw Error(`Tap function (tapPromise) did not return promise (returned ${promise})`);
|
|
476
|
-
promise.then(()=>{
|
|
477
|
-
(index += 1) === tapsInRange.length ? done() : next();
|
|
478
|
-
}, (e)=>{
|
|
479
|
-
index = tapsInRange.length, error(e);
|
|
480
|
-
});
|
|
481
|
-
} else if ('async' === tap.type) tap.fn(...args2, (e)=>{
|
|
482
|
-
e ? (index = tapsInRange.length, error(e)) : (index += 1) === tapsInRange.length ? done() : next();
|
|
483
|
-
});
|
|
484
|
-
else {
|
|
485
|
-
let hasError = !1;
|
|
486
|
-
try {
|
|
487
|
-
tap.fn(...args2);
|
|
488
|
-
} catch (e) {
|
|
489
|
-
hasError = !0, index = tapsInRange.length, error(e);
|
|
490
|
-
}
|
|
491
|
-
hasError || ((index += 1) === tapsInRange.length ? done() : next());
|
|
492
|
-
}
|
|
493
|
-
if (index === tapsInRange.length) return;
|
|
494
|
-
};
|
|
495
|
-
next();
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
class AsyncSeriesBailHook extends HookBase {
|
|
499
|
-
callAsyncStageRange(queried, ...args) {
|
|
500
|
-
let { stageRange: [from], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
501
|
-
from === minStage && this._runCallInterceptors(...args2);
|
|
502
|
-
let done = ()=>{
|
|
503
|
-
this._runDoneInterceptors(), cb(null);
|
|
504
|
-
}, error = (e)=>{
|
|
505
|
-
this._runErrorInterceptors(e), cb(e);
|
|
506
|
-
}, result = (r)=>{
|
|
507
|
-
this._runResultInterceptors(r), cb(null, r);
|
|
508
|
-
};
|
|
509
|
-
if (0 === tapsInRange.length) return done();
|
|
510
|
-
let index = 0, next = ()=>{
|
|
511
|
-
let tap = tapsInRange[index];
|
|
512
|
-
if (this._runTapInterceptors(tap), 'promise' === tap.type) {
|
|
513
|
-
let promise = tap.fn(...args2);
|
|
514
|
-
if (!promise || !promise.then) throw Error(`Tap function (tapPromise) did not return promise (returned ${promise})`);
|
|
515
|
-
promise.then((r)=>{
|
|
516
|
-
index += 1, void 0 !== r ? result(r) : index === tapsInRange.length ? done() : next();
|
|
517
|
-
}, (e)=>{
|
|
518
|
-
index = tapsInRange.length, error(e);
|
|
519
|
-
});
|
|
520
|
-
} else if ('async' === tap.type) tap.fn(...args2, (e, r)=>{
|
|
521
|
-
e ? (index = tapsInRange.length, error(e)) : (index += 1, void 0 !== r ? result(r) : index === tapsInRange.length ? done() : next());
|
|
522
|
-
});
|
|
523
|
-
else {
|
|
524
|
-
let r, hasError = !1;
|
|
525
|
-
try {
|
|
526
|
-
r = tap.fn(...args2);
|
|
527
|
-
} catch (e) {
|
|
528
|
-
hasError = !0, index = tapsInRange.length, error(e);
|
|
529
|
-
}
|
|
530
|
-
hasError || (index += 1, void 0 !== r ? result(r) : index === tapsInRange.length ? done() : next());
|
|
531
|
-
}
|
|
532
|
-
if (index === tapsInRange.length) return;
|
|
533
|
-
};
|
|
534
|
-
next();
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
class AsyncSeriesWaterfallHook extends HookBase {
|
|
538
|
-
callAsyncStageRange(queried, ...args) {
|
|
539
|
-
let { stageRange: [from], tapsInRange } = queried, argsWithoutCb = args.slice(0, args.length - 1), cb = args[args.length - 1], args2 = this._prepareArgs(argsWithoutCb);
|
|
540
|
-
from === minStage && this._runCallInterceptors(...args2);
|
|
541
|
-
let result = (r)=>{
|
|
542
|
-
this._runResultInterceptors(r), cb(null, r);
|
|
543
|
-
}, error = (e)=>{
|
|
544
|
-
this._runErrorInterceptors(e), cb(e);
|
|
545
|
-
};
|
|
546
|
-
if (0 === tapsInRange.length) return result(args2[0]);
|
|
547
|
-
let index = 0, next = ()=>{
|
|
548
|
-
let tap = tapsInRange[index];
|
|
549
|
-
if (this._runTapInterceptors(tap), 'promise' === tap.type) {
|
|
550
|
-
let promise = tap.fn(...args2);
|
|
551
|
-
if (!promise || !promise.then) throw Error(`Tap function (tapPromise) did not return promise (returned ${promise})`);
|
|
552
|
-
promise.then((r)=>{
|
|
553
|
-
index += 1, void 0 !== r && (args2[0] = r), index === tapsInRange.length ? result(args2[0]) : next();
|
|
554
|
-
}, (e)=>{
|
|
555
|
-
index = tapsInRange.length, error(e);
|
|
556
|
-
});
|
|
557
|
-
} else if ('async' === tap.type) tap.fn(...args2, (e, r)=>{
|
|
558
|
-
e ? (index = tapsInRange.length, error(e)) : (index += 1, void 0 !== r && (args2[0] = r), index === tapsInRange.length ? result(args2[0]) : next());
|
|
559
|
-
});
|
|
560
|
-
else {
|
|
561
|
-
let hasError = !1;
|
|
562
|
-
try {
|
|
563
|
-
let r = tap.fn(...args2);
|
|
564
|
-
void 0 !== r && (args2[0] = r);
|
|
565
|
-
} catch (e) {
|
|
566
|
-
hasError = !0, index = tapsInRange.length, error(e);
|
|
567
|
-
}
|
|
568
|
-
hasError || ((index += 1) === tapsInRange.length ? result(args2[0]) : next());
|
|
569
|
-
}
|
|
570
|
-
if (index === tapsInRange.length) return;
|
|
571
|
-
};
|
|
572
|
-
next();
|
|
573
|
-
}
|
|
574
|
-
constructor(args = [], name){
|
|
575
|
-
if (args.length < 1) throw Error('Waterfall hooks must have at least one argument');
|
|
576
|
-
super(args, name);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
let defaultFactory = (key, hook)=>hook;
|
|
580
|
-
class HookMap {
|
|
581
|
-
get(key) {
|
|
582
|
-
return this._map.get(key);
|
|
583
|
-
}
|
|
584
|
-
for(key) {
|
|
585
|
-
let hook = this.get(key);
|
|
586
|
-
if (void 0 !== hook) return hook;
|
|
587
|
-
let newHook = this._factory(key), interceptors = this._interceptors;
|
|
588
|
-
for(let i = 0; i < interceptors.length; i++){
|
|
589
|
-
let factory = interceptors[i].factory;
|
|
590
|
-
factory && (newHook = factory(key, newHook));
|
|
591
|
-
}
|
|
592
|
-
return this._map.set(key, newHook), newHook;
|
|
593
|
-
}
|
|
594
|
-
intercept(interceptor) {
|
|
595
|
-
this._interceptors.push(Object.assign({
|
|
596
|
-
factory: defaultFactory
|
|
597
|
-
}, interceptor));
|
|
598
|
-
}
|
|
599
|
-
isUsed() {
|
|
600
|
-
for (let key of this._map.keys()){
|
|
601
|
-
let hook = this.get(key);
|
|
602
|
-
if (hook?.isUsed()) return !0;
|
|
603
|
-
}
|
|
604
|
-
return !1;
|
|
605
|
-
}
|
|
606
|
-
queryStageRange(stageRange) {
|
|
607
|
-
return new QueriedHookMap(stageRange, this);
|
|
608
|
-
}
|
|
609
|
-
constructor(factory, name){
|
|
610
|
-
_define_property(this, "_map", new Map()), _define_property(this, "_factory", void 0), _define_property(this, "name", void 0), _define_property(this, "_interceptors", void 0), this.name = name, this._factory = factory, this._interceptors = [];
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
class QueriedHookMap {
|
|
614
|
-
get(key) {
|
|
615
|
-
return this.hookMap.get(key)?.queryStageRange(this.stageRange);
|
|
616
|
-
}
|
|
617
|
-
for(key) {
|
|
618
|
-
return this.hookMap.for(key).queryStageRange(this.stageRange);
|
|
619
|
-
}
|
|
620
|
-
isUsed() {
|
|
621
|
-
for (let key of this.hookMap._map.keys())if (this.get(key)?.isUsed()) return !0;
|
|
622
|
-
return !1;
|
|
623
|
-
}
|
|
624
|
-
constructor(stageRange, hookMap){
|
|
625
|
-
_define_property(this, "stageRange", void 0), _define_property(this, "hookMap", void 0), this.stageRange = stageRange, this.hookMap = hookMap;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
class MultiHook {
|
|
629
|
-
tap(options, fn) {
|
|
630
|
-
for (let hook of this.hooks)hook.tap(options, fn);
|
|
631
|
-
}
|
|
632
|
-
tapAsync(options, fn) {
|
|
633
|
-
for (let hook of this.hooks)hook.tapAsync(options, fn);
|
|
634
|
-
}
|
|
635
|
-
tapPromise(options, fn) {
|
|
636
|
-
for (let hook of this.hooks)hook.tapPromise(options, fn);
|
|
637
|
-
}
|
|
638
|
-
isUsed() {
|
|
639
|
-
for (let hook of this.hooks)if (hook.isUsed()) return !0;
|
|
640
|
-
return !1;
|
|
641
|
-
}
|
|
642
|
-
intercept(interceptor) {
|
|
643
|
-
for (let hook of this.hooks)hook.intercept(interceptor);
|
|
644
|
-
}
|
|
645
|
-
withOptions(options) {
|
|
646
|
-
return new MultiHook(this.hooks.map((h)=>h.withOptions(options)), this.name);
|
|
647
|
-
}
|
|
648
|
-
constructor(hooks, name){
|
|
649
|
-
_define_property(this, "hooks", void 0), _define_property(this, "name", void 0), this.hooks = hooks, this.name = name;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
for(var __rspack_i in __nested_rspack_require_18_37__.d(__nested_rspack_exports__, {
|
|
653
|
-
AsyncParallelHook: ()=>AsyncParallelHook,
|
|
654
|
-
AsyncSeriesBailHook: ()=>AsyncSeriesBailHook,
|
|
655
|
-
AsyncSeriesHook: ()=>AsyncSeriesHook,
|
|
656
|
-
AsyncSeriesWaterfallHook: ()=>AsyncSeriesWaterfallHook,
|
|
657
|
-
HookBase: ()=>HookBase,
|
|
658
|
-
HookMap: ()=>HookMap,
|
|
659
|
-
MultiHook: ()=>MultiHook,
|
|
660
|
-
QueriedHook: ()=>QueriedHook,
|
|
661
|
-
QueriedHookMap: ()=>QueriedHookMap,
|
|
662
|
-
SyncBailHook: ()=>SyncBailHook,
|
|
663
|
-
SyncHook: ()=>SyncHook,
|
|
664
|
-
SyncWaterfallHook: ()=>SyncWaterfallHook
|
|
665
|
-
}, {
|
|
666
|
-
maxStage: maxStage,
|
|
667
|
-
minStage: minStage,
|
|
668
|
-
safeStage: (stage)=>stage < -2147483648 ? -2147483648 : stage > i32MAX ? i32MAX : stage
|
|
669
|
-
}), exports.AsyncParallelHook = __nested_rspack_exports__.AsyncParallelHook, exports.AsyncSeriesBailHook = __nested_rspack_exports__.AsyncSeriesBailHook, exports.AsyncSeriesHook = __nested_rspack_exports__.AsyncSeriesHook, exports.AsyncSeriesWaterfallHook = __nested_rspack_exports__.AsyncSeriesWaterfallHook, exports.HookBase = __nested_rspack_exports__.HookBase, exports.HookMap = __nested_rspack_exports__.HookMap, exports.MultiHook = __nested_rspack_exports__.MultiHook, exports.QueriedHook = __nested_rspack_exports__.QueriedHook, exports.QueriedHookMap = __nested_rspack_exports__.QueriedHookMap, exports.SyncBailHook = __nested_rspack_exports__.SyncBailHook, exports.SyncHook = __nested_rspack_exports__.SyncHook, exports.SyncWaterfallHook = __nested_rspack_exports__.SyncWaterfallHook, exports.maxStage = __nested_rspack_exports__.maxStage, exports.minStage = __nested_rspack_exports__.minStage, exports.safeStage = __nested_rspack_exports__.safeStage, __nested_rspack_exports__)-1 === [
|
|
670
|
-
"AsyncParallelHook",
|
|
671
|
-
"AsyncSeriesBailHook",
|
|
672
|
-
"AsyncSeriesHook",
|
|
673
|
-
"AsyncSeriesWaterfallHook",
|
|
674
|
-
"HookBase",
|
|
675
|
-
"HookMap",
|
|
676
|
-
"MultiHook",
|
|
677
|
-
"QueriedHook",
|
|
678
|
-
"QueriedHookMap",
|
|
679
|
-
"SyncBailHook",
|
|
680
|
-
"SyncHook",
|
|
681
|
-
"SyncWaterfallHook",
|
|
682
|
-
"maxStage",
|
|
683
|
-
"minStage",
|
|
684
|
-
"safeStage"
|
|
685
|
-
].indexOf(__rspack_i) && (exports[__rspack_i] = __nested_rspack_exports__[__rspack_i]);
|
|
686
|
-
Object.defineProperty(exports, "__esModule", {
|
|
687
|
-
value: !0
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.4/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
|
|
692
|
-
export { 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.1.5/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.1.5/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.1.5/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.1.5/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.1.5/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 c(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(l),...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(l),...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,i=1/0,l=[a,1/0],p=0x80000000-1;class c{isUsed(){return!!(this.tapsInRange.length>0||this.stageRange[0]===a&&this.hook.interceptors.some(e=>e.call)||this.stageRange[1]===i&&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):o===i&&t===i&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...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 u extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}if(void 0!==t)return this._runResultInterceptors(t),l(null,t)}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...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 g extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{let t=e.fn(...p);void 0!==t&&(p[0]=t)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null,p[0]))}call(...e){return this.callStageRange(this.queryStageRange(l),...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 f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(c-=1)&&l()},e=>{c=0,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=0,p(e)):0==(c-=1)&&l()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=0,p(e)}t||0!=--c||l()}if(c<=0)return}}}class m extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(c+=1)===r.length?l():h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=r.length,p(e)):(c+=1)===r.length?l():h()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l():h())}if(c===r.length)return};h()}}class d extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)},c=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return l();let h=0,u=()=>{let e=r[h];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{h+=1,void 0!==e?c(e):h===r.length?l():u()},e=>{h=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(h=r.length,p(e)):(h+=1,void 0!==t?c(t):h===r.length?l():u())});else{let t,s=!1;try{t=e.fn(...i)}catch(e){s=!0,h=r.length,p(e)}s||(h+=1,void 0!==t?c(t):h===r.length?l():u())}if(h===r.length)return};u()}}class y extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=e=>{this._runResultInterceptors(e),o(null,e)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l(i[0]);let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e&&(i[0]=e),c===r.length?l(i[0]):h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(c=r.length,p(e)):(c+=1,void 0!==t&&(i[0]=t),c===r.length?l(i[0]):h())});else{let t=!1;try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l(i[0]):h())}if(c===r.length)return};h()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let k=(e,t)=>t;class S{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:k},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 _(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 _{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 A{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 A(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 H in s.d(r,{AsyncParallelHook:()=>f,AsyncSeriesBailHook:()=>d,AsyncSeriesHook:()=>m,AsyncSeriesWaterfallHook:()=>y,HookBase:()=>o,HookMap:()=>S,MultiHook:()=>A,QueriedHook:()=>c,QueriedHookMap:()=>_,SyncBailHook:()=>u,SyncHook:()=>h,SyncWaterfallHook:()=>g},{maxStage:i,minStage:a,safeStage:e=>e<-0x80000000?-0x80000000:e>p?p: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(H)&&(t[H]=r[H]);Object.defineProperty(t,"__esModule",{value:!0})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.5/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
|