@rsbuild/core 2.2.0-rc.0 → 2.2.1
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 +43 -33
- package/dist/manifest-plugin.js +1 -1
- package/dist/server/assets-middleware/index.d.ts +0 -1
- package/dist/types/context.d.ts +1 -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
|
+
138: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(264)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
264: (__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__(49);
|
|
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
|
+
49: (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__(138);
|
|
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.
|
|
3428
|
+
version: "2.2.1",
|
|
3429
3429
|
rootPath,
|
|
3430
3430
|
configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
|
|
3431
3431
|
configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
|
|
@@ -4097,7 +4097,11 @@ async function createCompiler_createCompiler(options) {
|
|
|
4097
4097
|
})(version, '2.0.0') >= 0)) throw Error(`${color.dim('[rsbuild]')} The current Rspack version does not meet the requirements, the minimum supported version of Rspack is ${color.green("2.0.0")}`);
|
|
4098
4098
|
let isMultiCompiler = rspackConfigs.length > 1, compiler = isMultiCompiler ? core_rspack(rspackConfigs) : core_rspack(rspackConfigs[0]);
|
|
4099
4099
|
'true' === process.env.RSPACK_UNSAFE_FAST_DROP && (compiler.unsafeFastDrop = !0);
|
|
4100
|
-
let isVersionLogged = !1, isCompiling = !1,
|
|
4100
|
+
let isVersionLogged = !1, isCompiling = !1, hasFatalError = !1, compilers = isMultiCompiler ? compiler.compilers : [
|
|
4101
|
+
compiler
|
|
4102
|
+
], finishFatalBuild = ()=>{
|
|
4103
|
+
!hasFatalError || compilers.some((item)=>item.watching ? item.watching.running : item.running) || (context.buildState.status = 'failed', context.buildState.hasErrors = !0, isCompiling = !1);
|
|
4104
|
+
}, logRspackVersion = ()=>{
|
|
4101
4105
|
isVersionLogged || (logger.debug(`using Rspack v${core_rspack.rspackVersion}`), isVersionLogged = !0);
|
|
4102
4106
|
}, lazyModules = new Set();
|
|
4103
4107
|
compiler.hooks.infrastructureLog.tap(HOOK_NAME, (name, _, args)=>{
|
|
@@ -4113,13 +4117,16 @@ async function createCompiler_createCompiler(options) {
|
|
|
4113
4117
|
}
|
|
4114
4118
|
});
|
|
4115
4119
|
let startTime = null;
|
|
4116
|
-
compiler.hooks.run.tap(HOOK_NAME, ()=>{
|
|
4120
|
+
for (let item of (compiler.hooks.run.tap(HOOK_NAME, ()=>{
|
|
4117
4121
|
startTime = Date.now(), context.buildState.status = 'building';
|
|
4118
4122
|
}), compiler.hooks.watchRun.tap(HOOK_NAME, (compiler)=>{
|
|
4119
4123
|
startTime = Date.now(), context.buildState.status = 'building', logRspackVersion(), isCompiling || printBuildLog(compiler, context, lazyModules), lazyModules.size && lazyModules.clear(), isCompiling = !0;
|
|
4120
4124
|
}), compiler.hooks.invalid.tap(HOOK_NAME, ()=>{
|
|
4121
|
-
context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
|
|
4122
|
-
}),
|
|
4125
|
+
hasFatalError = !1, context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
|
|
4126
|
+
}), compilers))item.hooks.failed.tap(HOOK_NAME, ()=>{
|
|
4127
|
+
hasFatalError = !0, context.buildState.hasErrors = !0, finishFatalBuild();
|
|
4128
|
+
}), item.hooks.afterDone.tap(HOOK_NAME, finishFatalBuild), item.hooks.watchClose.tap(HOOK_NAME, finishFatalBuild);
|
|
4129
|
+
'build' === context.action && (isMultiCompiler ? compiler.compilers[0] : compiler).hooks.run.tap(HOOK_NAME, ()=>{
|
|
4123
4130
|
logger.info('build started...'), logRspackVersion();
|
|
4124
4131
|
});
|
|
4125
4132
|
let printTime = (index, hasErrors)=>{
|
|
@@ -4145,6 +4152,7 @@ async function createCompiler_createCompiler(options) {
|
|
|
4145
4152
|
printTime(index, stats.hasErrors());
|
|
4146
4153
|
});
|
|
4147
4154
|
}), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
|
|
4155
|
+
hasFatalError = !1;
|
|
4148
4156
|
let stats = getRsbuildStats(statsInstance, compiler, logger, context.action), hasErrors = statsInstance.hasErrors();
|
|
4149
4157
|
context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors, context.socketServer?.onBuildDone();
|
|
4150
4158
|
let { message, level } = formatStats(stats, hasErrors, options.context.rootPath, logger);
|
|
@@ -6339,6 +6347,7 @@ function resolveDefaultPreset(config) {
|
|
|
6339
6347
|
}
|
|
6340
6348
|
function resolvePerPackagePreset() {
|
|
6341
6349
|
return {
|
|
6350
|
+
chunks: 'all',
|
|
6342
6351
|
minSize: 0,
|
|
6343
6352
|
maxInitialRequests: 1 / 0,
|
|
6344
6353
|
cacheGroups: {
|
|
@@ -6566,7 +6575,11 @@ async function resolveHostname(host = LOCALHOST) {
|
|
|
6566
6575
|
}
|
|
6567
6576
|
return void 0 === host || WILDCARD_HOSTS.has(host) ? LOCALHOST : host;
|
|
6568
6577
|
}
|
|
6569
|
-
let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)
|
|
6578
|
+
let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/, getFileFromUrl_stat = (filename, outputFileSystem)=>new Promise((resolve, reject)=>{
|
|
6579
|
+
outputFileSystem.stat(filename, (err, stats)=>{
|
|
6580
|
+
err ? reject(err) : resolve(stats);
|
|
6581
|
+
});
|
|
6582
|
+
});
|
|
6570
6583
|
async function getFileFromUrl(url, outputFileSystem, context) {
|
|
6571
6584
|
let pathname = getPathnameFromUrl(url);
|
|
6572
6585
|
try {
|
|
@@ -6583,11 +6596,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6583
6596
|
if (UP_PATH_REGEXP.test(node_path.normalize(`./${pathname}`))) return {
|
|
6584
6597
|
errorCode: 403
|
|
6585
6598
|
};
|
|
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();
|
|
6599
|
+
let { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
|
|
6591
6600
|
for (let [index, distPath] of distPaths.entries()){
|
|
6592
6601
|
let prefix = publicPathnames[index];
|
|
6593
6602
|
prefix && '/' !== prefix && isUrlPathUnderBase(pathname, prefix) && possibleFilenames.add(node_path.join(distPath, pathname.slice(prefix.length)));
|
|
@@ -6596,7 +6605,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6596
6605
|
for (let filename of possibleFilenames){
|
|
6597
6606
|
let fsStats;
|
|
6598
6607
|
try {
|
|
6599
|
-
fsStats = await
|
|
6608
|
+
fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
|
|
6600
6609
|
} catch {
|
|
6601
6610
|
continue;
|
|
6602
6611
|
}
|
|
@@ -6608,7 +6617,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6608
6617
|
if (fsStats.isDirectory()) {
|
|
6609
6618
|
filename = node_path.join(filename, 'index.html');
|
|
6610
6619
|
try {
|
|
6611
|
-
fsStats = await
|
|
6620
|
+
fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
|
|
6612
6621
|
} catch {
|
|
6613
6622
|
continue;
|
|
6614
6623
|
}
|
|
@@ -6893,8 +6902,8 @@ function applyHMREntry({ config, compiler, token, resolvedHost, resolvedPort })
|
|
|
6893
6902
|
var overlay;
|
|
6894
6903
|
let overlay1;
|
|
6895
6904
|
if (!((compiler)=>{
|
|
6896
|
-
let {
|
|
6897
|
-
return !!
|
|
6905
|
+
let { platform } = compiler;
|
|
6906
|
+
return !!(platform.web && !platform.webworker && compiler.options.output.environment?.document);
|
|
6898
6907
|
})(compiler) || !config.dev.hmr && !config.dev.liveReload) return;
|
|
6899
6908
|
let { enabled: liveReloadEnabled } = normalizeLiveReload(config.dev.liveReload), { webSocketUrlResolver, ...clientConfig } = {
|
|
6900
6909
|
...config.dev.client
|
|
@@ -6976,12 +6985,12 @@ let assets_middleware_assetsMiddleware = async ({ config, compiler, context, soc
|
|
|
6976
6985
|
});
|
|
6977
6986
|
let compilers = compiler_isMultiCompiler(compiler) ? compiler.compilers : [
|
|
6978
6987
|
compiler
|
|
6979
|
-
], callbacks = []
|
|
6988
|
+
], callbacks = [], flushCallbacks = ()=>{
|
|
6989
|
+
for (let callback of callbacks.splice(0))callback();
|
|
6990
|
+
};
|
|
6980
6991
|
compiler.hooks.done.tap('rsbuild-dev-middleware', ()=>{
|
|
6981
6992
|
process.nextTick(()=>{
|
|
6982
|
-
'done' === context.buildState.status && (
|
|
6983
|
-
callback();
|
|
6984
|
-
}), callbacks.length = 0);
|
|
6993
|
+
'done' === context.buildState.status && flushCallbacks();
|
|
6985
6994
|
});
|
|
6986
6995
|
});
|
|
6987
6996
|
let writeToDisk = (config1 = config.dev, 1 === new Set(writeToDiskValues = environmentList.map((env)=>env.config.dev.writeToDisk)).size ? writeToDiskValues[0] : (filePath, name)=>{
|
|
@@ -6990,14 +6999,14 @@ let assets_middleware_assetsMiddleware = async ({ config, compiler, context, soc
|
|
|
6990
6999
|
});
|
|
6991
7000
|
writeToDisk && setupWriteToDisk(compilers, writeToDisk, logger);
|
|
6992
7001
|
let instance = createAssetsMiddleware(context, (callback)=>{
|
|
6993
|
-
'done' === context.buildState.status ? callback() : callbacks.push(callback);
|
|
7002
|
+
'done' === context.buildState.status || 'failed' === context.buildState.status ? callback() : callbacks.push(callback);
|
|
6994
7003
|
}, await setupOutputFileSystem(writeToDisk, compilers));
|
|
6995
7004
|
return instance.watch = ()=>{
|
|
6996
7005
|
if (compiler.watching) watching = compiler.watching;
|
|
6997
7006
|
else {
|
|
6998
7007
|
let watchOptions = compilers.length > 1 ? compilers.map(({ options })=>options.watchOptions || {}) : compilers[0].options.watchOptions || {};
|
|
6999
7008
|
watching = compiler.watch(watchOptions, (error)=>{
|
|
7000
|
-
error && (error.message?.includes('× Error:') && (error.message = error.message.replace('× Error:', '').trim()), logger.error(error));
|
|
7009
|
+
error && (context.buildState.status = 'failed', context.buildState.hasErrors = !0, process.nextTick(flushCallbacks), error.message?.includes('× Error:') && (error.message = error.message.replace('× Error:', '').trim()), logger.error(error));
|
|
7001
7010
|
});
|
|
7002
7011
|
}
|
|
7003
7012
|
}, instance.close = (callback = noop)=>{
|
|
@@ -9393,7 +9402,8 @@ try {
|
|
|
9393
9402
|
else {
|
|
9394
9403
|
let { preset = 'none', ...rest } = splitChunks;
|
|
9395
9404
|
chain.optimization.splitChunks({
|
|
9396
|
-
chunks: 'all',
|
|
9405
|
+
chunks: Object.keys(environment.entry).length > 1 ? 'all' : 'async',
|
|
9406
|
+
minSize: 0,
|
|
9397
9407
|
...getSplitChunksByPreset(config, preset),
|
|
9398
9408
|
...rest
|
|
9399
9409
|
});
|
|
@@ -9656,7 +9666,7 @@ try {
|
|
|
9656
9666
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
|
|
9657
9667
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
9658
9668
|
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.
|
|
9669
|
+
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.1/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
9660
9670
|
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
9661
9671
|
let pluginOptions = {
|
|
9662
9672
|
fileName: manifestOptions.filename,
|
|
@@ -10199,7 +10209,7 @@ let applyServerOptions = (command)=>{
|
|
|
10199
10209
|
};
|
|
10200
10210
|
function setupCommands(argv) {
|
|
10201
10211
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
10202
|
-
cli.version("2.2.
|
|
10212
|
+
cli.version("2.2.1"), 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
10213
|
default: 'auto'
|
|
10204
10214
|
}).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
10215
|
type: [
|
|
@@ -10264,7 +10274,7 @@ function setupCommands(argv) {
|
|
|
10264
10274
|
}
|
|
10265
10275
|
function showGreeting() {
|
|
10266
10276
|
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.
|
|
10277
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.1\n`);
|
|
10268
10278
|
}
|
|
10269
10279
|
function setupLogLevel(argv) {
|
|
10270
10280
|
if (argv.length <= 3) return;
|
|
@@ -10286,5 +10296,5 @@ function runCLI({ argv = process.argv } = {}) {
|
|
|
10286
10296
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
10287
10297
|
}
|
|
10288
10298
|
}
|
|
10289
|
-
let src_version = "2.2.
|
|
10299
|
+
let src_version = "2.2.1";
|
|
10290
10300
|
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.1/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.1/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.1/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.1/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.1/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.1/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/dist/types/context.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type ActionType = 'dev' | 'build' | 'preview';
|
|
|
55
55
|
* - `rspress` is set when Rspress calls Rsbuild.
|
|
56
56
|
*/ callerName: string;
|
|
57
57
|
};
|
|
58
|
-
export type BuildStatus = 'idle' | 'building' | 'done';
|
|
58
|
+
export type BuildStatus = /** No build is running yet, or the previous result has been invalidated. */ 'idle' | 'building' | 'done' | 'failed';
|
|
59
59
|
export type BuildState = {
|
|
60
60
|
/**
|
|
61
61
|
* The stats object of the last build.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
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.
|
|
38
|
+
"@rspack/core": "~2.2.1",
|
|
39
39
|
"@swc/helpers": "^0.5.23"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|