@rsbuild/core 2.3.1 → 2.3.2
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 +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/dist/m.js +76 -63
- package/dist/manifest-plugin.js +1 -1
- package/dist/server/assets-middleware/middleware.d.ts +0 -5
- package/dist/server/helper.d.ts +2 -1
- package/dist/types/config.d.ts +8 -3
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
714: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(251);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
}
|
|
308
308
|
module.exports = { CachedChildCompilation };
|
|
309
309
|
},
|
|
310
|
-
|
|
310
|
+
251: (module) => {
|
|
311
311
|
"use strict";
|
|
312
312
|
class HtmlWebpackChildCompiler {
|
|
313
313
|
compilationPromise;
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
}
|
|
477
477
|
module.exports = { HtmlWebpackChildCompiler };
|
|
478
478
|
},
|
|
479
|
-
|
|
479
|
+
697: (module) => {
|
|
480
480
|
"use strict";
|
|
481
481
|
function none(chunks) {
|
|
482
482
|
return chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
}
|
|
493
493
|
module.exports = { auto: none, manual, none };
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
160: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
};
|
|
517
517
|
};
|
|
518
518
|
},
|
|
519
|
-
|
|
519
|
+
239: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
520
520
|
"use strict";
|
|
521
521
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(537);
|
|
522
522
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -542,7 +542,7 @@
|
|
|
542
542
|
}
|
|
543
543
|
module.exports = { getHtmlRspackPluginHooks };
|
|
544
544
|
},
|
|
545
|
-
|
|
545
|
+
790: (module) => {
|
|
546
546
|
const voidTags = [
|
|
547
547
|
"area",
|
|
548
548
|
"base",
|
|
@@ -610,19 +610,19 @@
|
|
|
610
610
|
htmlTagObjectToString,
|
|
611
611
|
};
|
|
612
612
|
},
|
|
613
|
-
|
|
613
|
+
319: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
614
614
|
"use strict";
|
|
615
615
|
const promisify = __nccwpck_require__(23).promisify;
|
|
616
616
|
const vm = __nccwpck_require__(154);
|
|
617
617
|
const fs = __nccwpck_require__(896);
|
|
618
618
|
const path = __nccwpck_require__(928);
|
|
619
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
619
|
+
const { CachedChildCompilation } = __nccwpck_require__(714);
|
|
620
620
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
621
|
-
__nccwpck_require__(
|
|
622
|
-
const prettyError = __nccwpck_require__(
|
|
623
|
-
const chunkSorter = __nccwpck_require__(
|
|
621
|
+
__nccwpck_require__(790);
|
|
622
|
+
const prettyError = __nccwpck_require__(160);
|
|
623
|
+
const chunkSorter = __nccwpck_require__(697);
|
|
624
624
|
const getHtmlRspackPluginHooks =
|
|
625
|
-
__nccwpck_require__(
|
|
625
|
+
__nccwpck_require__(239).getHtmlRspackPluginHooks;
|
|
626
626
|
const WITH_PLACEHOLDER = "function __with_placeholder__";
|
|
627
627
|
class HtmlRspackPlugin {
|
|
628
628
|
constructor(userOptions = {}) {
|
|
@@ -2445,6 +2445,6 @@
|
|
|
2445
2445
|
}
|
|
2446
2446
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
2447
2447
|
__nccwpck_require__.ab = __dirname + "/";
|
|
2448
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
2448
|
+
var __webpack_exports__ = __nccwpck_require__(319);
|
|
2449
2449
|
module.exports = __webpack_exports__;
|
|
2450
2450
|
})();
|
|
@@ -2008,7 +2008,7 @@
|
|
|
2008
2008
|
if (t.minimal && !l.test(e)) return e;
|
|
2009
2009
|
const d = hexadecimal(e.charCodeAt(0), y);
|
|
2010
2010
|
return u || d.length > 2 ? fourHexEscape(d) : "\\x" + ("00" + d).slice(-2);
|
|
2011
|
-
}), "`" == m && (T = T.replace(/\$\{/g, "\\${")), t.isScriptContext && (T = T.replace(/<\/(script|style)/gi, "<\\/$1").replace(
|
|
2011
|
+
}), "`" == m && (T = T.replace(/\$\{/g, "\\${")), t.isScriptContext && (T = T.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<\x21--/g, u ? "\\u003C!--" : "\\x3C!--")), t.wrap && (T = m + T + m), T;
|
|
2012
2012
|
};
|
|
2013
2013
|
jsesc.version = "3.0.2", e.exports = jsesc;
|
|
2014
2014
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
720: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(286)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
286: (__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__(567);
|
|
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
|
+
567: (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__(720);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
package/dist/m.js
CHANGED
|
@@ -207,7 +207,7 @@ moduleFactories.add({
|
|
|
207
207
|
if ('function' != typeof loader) throw Error('loader is not a function');
|
|
208
208
|
}
|
|
209
209
|
module.exports.lilconfig = function lilconfig(name, options) {
|
|
210
|
-
let { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache } = getOptions(name, options ?? {}, !1), searchCache = new Map(), loadCache = new Map(), emplace = (c, filepath, res)=>(cache && c.set(filepath, res), res);
|
|
210
|
+
let { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache } = getOptions(name, options ?? {}, !1), searchCache = new Map(), loadCache = new Map(), emplace = (0, (c, filepath, res)=>(cache && c.set(filepath, res), res));
|
|
211
211
|
return {
|
|
212
212
|
async search (searchFrom = process.cwd()) {
|
|
213
213
|
let result = {
|
|
@@ -941,16 +941,16 @@ var Command = class {
|
|
|
941
941
|
arg.variadic ? actionArgs.push(args.slice(index)) : actionArgs.push(args[index]);
|
|
942
942
|
}), actionArgs.push(options), command.commandAction.apply(this, actionArgs);
|
|
943
943
|
}
|
|
944
|
-
},
|
|
944
|
+
}, dist_webpack_modules_ = {}, dist_webpack_module_cache_ = {};
|
|
945
945
|
function dist_webpack_require_(moduleId) {
|
|
946
|
-
var cachedModule =
|
|
946
|
+
var cachedModule = dist_webpack_module_cache_[moduleId];
|
|
947
947
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
948
|
-
var module =
|
|
948
|
+
var module = dist_webpack_module_cache_[moduleId] = {
|
|
949
949
|
exports: {}
|
|
950
950
|
};
|
|
951
|
-
return
|
|
951
|
+
return dist_webpack_modules_[moduleId](module, module.exports, dist_webpack_require_), module.exports;
|
|
952
952
|
}
|
|
953
|
-
dist_webpack_require_.m =
|
|
953
|
+
dist_webpack_require_.m = dist_webpack_modules_, dist_webpack_require_.add = function(modules) {
|
|
954
954
|
Object.assign(dist_webpack_require_.m, modules);
|
|
955
955
|
}, dist_webpack_require_.add({
|
|
956
956
|
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
@@ -1170,7 +1170,7 @@ dist_webpack_require_.m = __webpack_modules__, dist_webpack_require_.add = funct
|
|
|
1170
1170
|
exports.A = void 0;
|
|
1171
1171
|
let stringify_1 = __webpack_require__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js"), quote_1 = __webpack_require__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), ROOT_SENTINEL = Symbol("root");
|
|
1172
1172
|
function replacerToString(replacer) {
|
|
1173
|
-
return replacer ? (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key) : stringify_1.toString;
|
|
1173
|
+
return replacer ? (0, (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key)) : stringify_1.toString;
|
|
1174
1174
|
}
|
|
1175
1175
|
exports.A = function stringify(value, replacer, indent, options = {}) {
|
|
1176
1176
|
let space = "string" == typeof indent ? indent : " ".repeat(indent || 0), path = [], stack = new Set(), tracking = new Map(), unpack = new Map(), valueCount = 0, { maxDepth = 100, references = !1, skipUndefinedProperties = !1, maxValues = 100000 } = options, valueToString = replacerToString(replacer), onNext = (value, key)=>{
|
|
@@ -1997,7 +1997,11 @@ let vendors_require = createRequire(import.meta.url);
|
|
|
1997
1997
|
var cjs_0_default = compatGetDefaultExport(rspackRequire("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/deepmerge/4.3.1/56471899410038644780b3527c5076e78d3f57091a0da3ac0daf6d994929353d/node_modules/deepmerge/dist/cjs.js"));
|
|
1998
1998
|
let setNodeEnv = (env)=>{
|
|
1999
1999
|
process.env.NODE_ENV = env;
|
|
2000
|
-
}, isCI = ()=>!!process.env.CI && 'false' !== process.env.CI, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj), objectPrototype = Object.prototype, helpers_getProto = Object.getPrototypeOf, isPlainObject = (obj)=>
|
|
2000
|
+
}, isCI = ()=>!!process.env.CI && 'false' !== process.env.CI, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj), objectPrototype = Object.prototype, helpers_getProto = Object.getPrototypeOf, isPlainObject = (obj)=>{
|
|
2001
|
+
if (null === obj || 'object' != typeof obj) return !1;
|
|
2002
|
+
let proto = helpers_getProto(obj);
|
|
2003
|
+
return null === proto || proto === objectPrototype || null === helpers_getProto(proto);
|
|
2004
|
+
}, helpers_castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
|
|
2001
2005
|
arr
|
|
2002
2006
|
], cloneDeep = (value)=>null == value ? value : cjs_0_default()({}, value, {
|
|
2003
2007
|
isMergeableObject: isPlainObject
|
|
@@ -2379,19 +2383,20 @@ let onBeforeCompile = ({ compiler, beforeCompile, beforeEnvironmentCompile, isWa
|
|
|
2379
2383
|
if (compiler_isMultiCompiler(compiler)) {
|
|
2380
2384
|
let { compilers } = compiler, compilerStats = [], doneCompilers = 0;
|
|
2381
2385
|
for(let index = 0; index < compilers.length; index++){
|
|
2382
|
-
let compiler = compilers[index],
|
|
2386
|
+
let compiler = compilers[index], compilerDone = !1, generation = 0, compilationGeneration = 0;
|
|
2383
2387
|
compiler.hooks.done.tapPromise('rsbuild:done', async (stats)=>{
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
await onEnvironmentDone(index, stats), lastCompilerDone && await onDone(new MultiStatsCtor(compilerStats));
|
|
2388
|
+
let currentGeneration = compilationGeneration;
|
|
2389
|
+
await onEnvironmentDone(index, stats), currentGeneration === generation && (!compilerDone && (compilerDone = !0, doneCompilers++), compilerStats[index] = stats, doneCompilers === compilers.length && await onDone(new MultiStatsCtor(compilerStats)));
|
|
2387
2390
|
});
|
|
2388
2391
|
let resetDoneState = ()=>{
|
|
2389
|
-
compilerDone && (compilerDone = !1, doneCompilers--);
|
|
2392
|
+
generation++, compilerDone && (compilerDone = !1, doneCompilers--);
|
|
2390
2393
|
};
|
|
2391
2394
|
compiler.hooks.invalid.tap('rsbuild:done', resetDoneState), compiler.hooks.watchRun.tap({
|
|
2392
2395
|
name: 'rsbuild:done',
|
|
2393
2396
|
stage: -1 / 0
|
|
2394
|
-
},
|
|
2397
|
+
}, ()=>{
|
|
2398
|
+
resetDoneState(), compilationGeneration = generation;
|
|
2399
|
+
});
|
|
2395
2400
|
}
|
|
2396
2401
|
} else compiler.hooks.done.tapPromise('rsbuild:done', async (stats)=>{
|
|
2397
2402
|
await onEnvironmentDone(0, stats), await onDone(stats);
|
|
@@ -2582,13 +2587,8 @@ let OVERRIDE_PATHS = new Set([
|
|
|
2582
2587
|
'provider',
|
|
2583
2588
|
'customLogger'
|
|
2584
2589
|
]), merge = (x, y, path = '')=>{
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
let realKey = key.split('.').slice(2).join('.');
|
|
2588
|
-
return OVERRIDE_PATHS.has(realKey);
|
|
2589
|
-
}
|
|
2590
|
-
return OVERRIDE_PATHS.has(key) || key.startsWith('output.filename.');
|
|
2591
|
-
})(path)) return y ?? x;
|
|
2590
|
+
let realKey;
|
|
2591
|
+
if (realKey = path.startsWith('environments.') ? path.split('.').slice(2).join('.') : path, OVERRIDE_PATHS.has(realKey) || realKey.startsWith('output.filename.')) return y ?? x;
|
|
2592
2592
|
if (void 0 === x) return isPlainObject(y) ? cloneDeep(y) : y;
|
|
2593
2593
|
if (void 0 === y) return isPlainObject(x) ? cloneDeep(x) : x;
|
|
2594
2594
|
let typeX = typeof x, typeY = typeof y;
|
|
@@ -3077,7 +3077,7 @@ function initPluginAPI({ context, pluginManager }) {
|
|
|
3077
3077
|
context: publicContext,
|
|
3078
3078
|
expose,
|
|
3079
3079
|
logger: context.logger,
|
|
3080
|
-
transform: (descriptor, handler)=>{
|
|
3080
|
+
transform: (0, (descriptor, handler)=>{
|
|
3081
3081
|
let id = `rsbuild-transform-${transformId++}`;
|
|
3082
3082
|
transformer[id] = handler, hooks.modifyBundlerChain.tapEnvironment({
|
|
3083
3083
|
environment: environment,
|
|
@@ -3092,24 +3092,24 @@ function initPluginAPI({ context, pluginManager }) {
|
|
|
3092
3092
|
void 0 !== descriptor.codeFilter && use.set('codeFilter', descriptor.codeFilter);
|
|
3093
3093
|
}
|
|
3094
3094
|
});
|
|
3095
|
-
},
|
|
3096
|
-
useExposed: (id)=>{
|
|
3095
|
+
}),
|
|
3096
|
+
useExposed: (0, (id)=>{
|
|
3097
3097
|
let exposedAPIs = exposed.get(id);
|
|
3098
3098
|
if (exposedAPIs) return void 0 !== environment && exposedAPIs.has(environment) ? exposedAPIs.get(environment) : exposedAPIs.get(GLOBAL_EXPOSED_KEY);
|
|
3099
|
-
},
|
|
3100
|
-
processAssets: (descriptor, handler)=>{
|
|
3099
|
+
}),
|
|
3100
|
+
processAssets: (0, (descriptor, handler)=>{
|
|
3101
3101
|
processAssetsFns.push({
|
|
3102
3102
|
environment: environment,
|
|
3103
3103
|
descriptor,
|
|
3104
3104
|
handler
|
|
3105
3105
|
});
|
|
3106
|
-
},
|
|
3107
|
-
resolve: (handler)=>{
|
|
3106
|
+
}),
|
|
3107
|
+
resolve: (0, (handler)=>{
|
|
3108
3108
|
resolveFns.push({
|
|
3109
3109
|
environment: environment,
|
|
3110
3110
|
handler
|
|
3111
3111
|
});
|
|
3112
|
-
},
|
|
3112
|
+
}),
|
|
3113
3113
|
getRsbuildConfig,
|
|
3114
3114
|
getNormalizedConfig,
|
|
3115
3115
|
isPluginExists: pluginManager.isPluginExists,
|
|
@@ -3258,7 +3258,7 @@ async function createContext(options, userConfig, logger, loadConfigResult) {
|
|
|
3258
3258
|
return config;
|
|
3259
3259
|
})(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, hooks = initHooks();
|
|
3260
3260
|
return {
|
|
3261
|
-
version: "2.3.
|
|
3261
|
+
version: "2.3.2",
|
|
3262
3262
|
rootPath,
|
|
3263
3263
|
configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
|
|
3264
3264
|
configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
|
|
@@ -3800,6 +3800,9 @@ async function initRsbuildConfig({ context, pluginManager }) {
|
|
|
3800
3800
|
},
|
|
3801
3801
|
server: {
|
|
3802
3802
|
...normalizedBaseConfig.server,
|
|
3803
|
+
...pick(environmentConfig.server ?? {}, [
|
|
3804
|
+
'serveAssets'
|
|
3805
|
+
]),
|
|
3803
3806
|
publicDir: void 0 === publicDir ? normalizedBaseConfig.server.publicDir : normalizePublicDirs(context.rootPath, publicDir)
|
|
3804
3807
|
}
|
|
3805
3808
|
}, { tsconfigPath } = normalizedEnvironmentConfig.source;
|
|
@@ -4057,8 +4060,8 @@ let normalizeUrl = (url)=>url.replace(/([^:]\/)\/+/g, '$1'), formatPrefix = (inp
|
|
|
4057
4060
|
if ('' === basePath || !url.startsWith(basePath)) return url;
|
|
4058
4061
|
let nextChar = url[basePath.length];
|
|
4059
4062
|
return void 0 === nextChar ? '/' : '/' === nextChar ? url.slice(basePath.length) : '?' === nextChar || '#' === nextChar ? `/${url.slice(basePath.length)}` : url;
|
|
4060
|
-
}, getRoutes = (context)=>{
|
|
4061
|
-
let environmentWithHtml = context.environmentList.filter((item)=>Object.keys(item.htmlPaths).length > 0);
|
|
4063
|
+
}, isServingAssets = (config)=>config.server.serveAssets ?? isWebTarget(config.output.target), getRoutes = (context)=>{
|
|
4064
|
+
let environmentWithHtml = context.environmentList.filter((item)=>isServingAssets(item.config) && Object.keys(item.htmlPaths).length > 0);
|
|
4062
4065
|
if (0 === environmentWithHtml.length) return [];
|
|
4063
4066
|
let commonDistPath = getCommonParentPath(environmentWithHtml.map((item)=>item.distPath));
|
|
4064
4067
|
return environmentWithHtml.reduce((prev, environmentContext)=>{
|
|
@@ -5225,7 +5228,7 @@ let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.(?:ts|mts|cts))$/, isSignifi
|
|
|
5225
5228
|
label: (diff > 0 ? color.red : color.green)(label),
|
|
5226
5229
|
length: label.length
|
|
5227
5230
|
};
|
|
5228
|
-
}, getAssetColor = (size)=>size > 300000 ? color.red : size > 100000 ? color.yellow : (input)=>input;
|
|
5231
|
+
}, getAssetColor = (size)=>size > 300000 ? color.red : size > 100000 ? color.yellow : (0, (input)=>input);
|
|
5229
5232
|
function getHeader(maxFileLength, maxSizeLength, fileHeader, compressionHeader) {
|
|
5230
5233
|
let lengths = [
|
|
5231
5234
|
maxFileLength,
|
|
@@ -5864,7 +5867,7 @@ function doesChunkBelongToHtml({ chunk, htmlPluginData }) {
|
|
|
5864
5867
|
let { options } = htmlPluginData.plugin;
|
|
5865
5868
|
return recursiveChunkEntryNames(chunk).some((chunkName)=>isChunksFiltered(chunkName, options?.chunks, options?.excludeChunks));
|
|
5866
5869
|
}
|
|
5867
|
-
let getManifestPlugin = cachedImport_cachedImport(()=>import("./manifest-plugin.js").then(rspackRequire.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/
|
|
5870
|
+
let getManifestPlugin = cachedImport_cachedImport(()=>import("./manifest-plugin.js").then(rspackRequire.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/index.js"))), isCSSPath = (filePath)=>filePath.endsWith('.css');
|
|
5868
5871
|
function normalizeManifestObjectConfig(manifest) {
|
|
5869
5872
|
let defaultOptions = {
|
|
5870
5873
|
prefix: !0,
|
|
@@ -5904,13 +5907,13 @@ function pluginModuleFederation() {
|
|
|
5904
5907
|
}
|
|
5905
5908
|
};
|
|
5906
5909
|
}
|
|
5907
|
-
function getPublicPath({ isDev, config, context }) {
|
|
5910
|
+
async function getPublicPath({ isDev, config, context }) {
|
|
5908
5911
|
let { dev, output, server } = config, publicPath = "/";
|
|
5909
5912
|
if (isDev) {
|
|
5910
5913
|
if ('string' == typeof dev.assetPrefix) publicPath = dev.assetPrefix;
|
|
5911
5914
|
else if (dev.assetPrefix) {
|
|
5912
|
-
let protocol = context.devServer?.https ? 'https' : 'http',
|
|
5913
|
-
publicPath =
|
|
5915
|
+
let protocol = context.devServer?.https ? 'https' : 'http', host = context.devServer?.hostname || LOCALHOST, hostname = WILDCARD_HOSTS.has(host) ? LOCALHOST : await getHostInUrl(host);
|
|
5916
|
+
publicPath = `${protocol}://${hostname}:<port>/`, server.base && '/' !== server.base && (publicPath = urlJoin(publicPath, server.base));
|
|
5914
5917
|
}
|
|
5915
5918
|
} else 'string' == typeof output.assetPrefix && (publicPath = output.assetPrefix);
|
|
5916
5919
|
let defaultPort = server.port ?? 3000;
|
|
@@ -6610,12 +6613,11 @@ function sendError(res, code) {
|
|
|
6610
6613
|
let byteLength = Buffer.byteLength(document);
|
|
6611
6614
|
res.setHeader('Content-Length', byteLength), res.end(document);
|
|
6612
6615
|
}
|
|
6613
|
-
let filterWebEnvironments = (environmentList)=>environmentList.filter((environment)=>isWebTarget(environment.config.output.target));
|
|
6614
6616
|
function createAssetsMiddleware(context, { waitForAssets, waitForBuild }, outputFileSystem) {
|
|
6615
|
-
let { logger } = context,
|
|
6617
|
+
let { logger } = context, servedEnvironments = context.environmentList.filter((environment)=>isServingAssets(environment.config)), assetContext = {
|
|
6616
6618
|
...context,
|
|
6617
|
-
environmentList:
|
|
6618
|
-
publicPathnames:
|
|
6619
|
+
environmentList: servedEnvironments,
|
|
6620
|
+
publicPathnames: servedEnvironments.map((environment)=>context.publicPathnames[environment.index])
|
|
6619
6621
|
};
|
|
6620
6622
|
return async function assetsMiddleware(req, res, next) {
|
|
6621
6623
|
function goNext() {
|
|
@@ -7284,7 +7286,7 @@ class BuildManager {
|
|
|
7284
7286
|
allCompilers,
|
|
7285
7287
|
webCompilers,
|
|
7286
7288
|
earlyWebUpdates
|
|
7287
|
-
});
|
|
7289
|
+
}), canServeWebAssetsEarly = earlyWebUpdates1 && !environmentList.some((environment)=>isServingAssets(environment.config) && !isWebTarget(environment.config.output.target));
|
|
7288
7290
|
applyToCompiler(compiler, (compiler, index)=>{
|
|
7289
7291
|
let environment = environmentList[index];
|
|
7290
7292
|
if (!environment) return;
|
|
@@ -7348,8 +7350,8 @@ class BuildManager {
|
|
|
7348
7350
|
'done' === context.buildState.status && flushAllCallbacks();
|
|
7349
7351
|
});
|
|
7350
7352
|
});
|
|
7351
|
-
let compiledWebCompilers = new Set(), isWebReady = ()=>
|
|
7352
|
-
if (
|
|
7353
|
+
let compiledWebCompilers = new Set(), isWebReady = ()=>canServeWebAssetsEarly && compiledWebCompilers.size === webCompilers1.length;
|
|
7354
|
+
if (canServeWebAssetsEarly) for (let item of webCompilers1){
|
|
7353
7355
|
let reset = ()=>{
|
|
7354
7356
|
compiledWebCompilers.delete(item);
|
|
7355
7357
|
};
|
|
@@ -7572,7 +7574,7 @@ let faviconFallbackMiddleware = (req, res, next)=>{
|
|
|
7572
7574
|
}, getRequestLoggerMiddleware = (logger)=>(req, res, next)=>{
|
|
7573
7575
|
let _startAt = process.hrtime();
|
|
7574
7576
|
finished(res, ()=>{
|
|
7575
|
-
let method = req.method, url = req.originalUrl || req.url, status = Number(res.statusCode), statusColor = status >= 500 ? color.red : status >= 400 ? color.yellow : status >= 300 ? color.cyan : status >= 200 ? color.green : (res)=>res, endAt = process.hrtime(), totalTime = (endAt[0] - _startAt[0]) * 1e3 + (endAt[1] - _startAt[1]) * 1e-6;
|
|
7577
|
+
let method = req.method, url = req.originalUrl || req.url, status = Number(res.statusCode), statusColor = status >= 500 ? color.red : status >= 400 ? color.yellow : status >= 300 ? color.cyan : status >= 200 ? color.green : (0, (res)=>res), endAt = process.hrtime(), totalTime = (endAt[0] - _startAt[0]) * 1e3 + (endAt[1] - _startAt[1]) * 1e-6;
|
|
7576
7578
|
logger.debug(`${statusColor(status)} ${method} ${url} ${color.dim(`${totalTime.toFixed(3)} ms`)}`);
|
|
7577
7579
|
}), next();
|
|
7578
7580
|
}, notFoundMiddleware = (_req, res, _next)=>{
|
|
@@ -8289,7 +8291,9 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
|
|
|
8289
8291
|
})(options.config, options.devServer, logger);
|
|
8290
8292
|
for (let middleware of before)middlewares.use(middleware);
|
|
8291
8293
|
let { onUpgrade } = await (async ({ config, buildManager, context, devServer, middlewares, postCallbacks })=>{
|
|
8292
|
-
let launchEditorHandlerPromise, upgradeEvents = [], { server } = config, { logger } = context
|
|
8294
|
+
let launchEditorHandlerPromise, upgradeEvents = [], { server } = config, { logger } = context, servedEnvironments = context.environmentList.filter((environment)=>isServingAssets(environment.config)), distPaths = [
|
|
8295
|
+
...new Set(servedEnvironments.map((environment)=>environment.distPath))
|
|
8296
|
+
];
|
|
8293
8297
|
if (server.cors) {
|
|
8294
8298
|
let { default: corsMiddleware } = await import("./cors.js").then(createFakeNamespaceObject.bind(rspackRequire, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/cors/2.8.6/abeeebb4dd5e2293f01aa9f4c01ff28ab19103cfa7a845442d515e16cf051f35/node_modules/cors/lib/index.js", 23));
|
|
8295
8299
|
middlewares.use(corsMiddleware('boolean' == typeof server.cors ? {} : server.cors));
|
|
@@ -8377,7 +8381,7 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
|
|
|
8377
8381
|
logger.error(err), res.writeHead(500), res.end('Failed to list the files');
|
|
8378
8382
|
}
|
|
8379
8383
|
})({
|
|
8380
|
-
environments: devServer.environments,
|
|
8384
|
+
environments: pick(devServer.environments, servedEnvironments.map((environment)=>environment.name)),
|
|
8381
8385
|
logger
|
|
8382
8386
|
})), buildManager && (middlewares.use(buildManager.assetsMiddleware), upgradeEvents.push(buildManager.socketServer.upgrade), middlewares.use(function hotUpdateJsonFallbackMiddleware(req, res, next) {
|
|
8383
8387
|
let url = req.url;
|
|
@@ -8386,9 +8390,7 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
|
|
|
8386
8390
|
url.endsWith('.hot-update.json', end) || url.endsWith('.hot-update.json.mjs', end) ? notFoundMiddleware(req, res, next) : next();
|
|
8387
8391
|
})), buildManager && middlewares.use(getHtmlCompletionMiddleware({
|
|
8388
8392
|
assetsMiddleware: buildManager.assetsMiddleware,
|
|
8389
|
-
distPaths
|
|
8390
|
-
context.distPath
|
|
8391
|
-
],
|
|
8393
|
+
distPaths,
|
|
8392
8394
|
outputFileSystem: buildManager.outputFileSystem
|
|
8393
8395
|
}));
|
|
8394
8396
|
let publicDirPaths = getPublicDirPaths(config);
|
|
@@ -8407,9 +8409,7 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
|
|
|
8407
8409
|
for (let callback of postCallbacks)await callback();
|
|
8408
8410
|
return server.historyApiFallback && (middlewares.use(historyApiFallback_historyApiFallbackMiddleware(logger, !0 === server.historyApiFallback ? {} : server.historyApiFallback)), buildManager?.assetsMiddleware && middlewares.use(buildManager.assetsMiddleware)), buildManager && server.htmlFallback && middlewares.use(getHtmlFallbackMiddleware({
|
|
8409
8411
|
assetsMiddleware: buildManager.assetsMiddleware,
|
|
8410
|
-
distPaths
|
|
8411
|
-
context.distPath
|
|
8412
|
-
],
|
|
8412
|
+
distPaths,
|
|
8413
8413
|
logger,
|
|
8414
8414
|
outputFileSystem: buildManager.outputFileSystem
|
|
8415
8415
|
})), middlewares.use(faviconFallbackMiddleware), {
|
|
@@ -8490,12 +8490,14 @@ async function startPreviewServer(context, config, { getPortSilently } = {}) {
|
|
|
8490
8490
|
server: previewServer,
|
|
8491
8491
|
environments: context.environments
|
|
8492
8492
|
});
|
|
8493
|
-
let
|
|
8493
|
+
let servedEnvironments = context.environmentList.filter((environment)=>isServingAssets(environment.config)), assetsMiddleware = createAssetsMiddleware(context, {
|
|
8494
8494
|
waitForAssets: (callback)=>callback(),
|
|
8495
8495
|
waitForBuild: (callback)=>callback()
|
|
8496
8496
|
}, node_fs), htmlMiddlewareOptions = {
|
|
8497
8497
|
assetsMiddleware,
|
|
8498
|
-
distPaths:
|
|
8498
|
+
distPaths: [
|
|
8499
|
+
...new Set(servedEnvironments.map((environment)=>environment.distPath))
|
|
8500
|
+
],
|
|
8499
8501
|
outputFileSystem: node_fs
|
|
8500
8502
|
};
|
|
8501
8503
|
if (isVerbose(logger) && middlewares.use(getRequestLoggerMiddleware(logger)), cors) {
|
|
@@ -8675,7 +8677,10 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
8675
8677
|
api.modifyBundlerChain(async (chain, { environment, env })=>{
|
|
8676
8678
|
let { config } = environment, { buildCache = !1 } = config.performance;
|
|
8677
8679
|
if (!1 === buildCache) return;
|
|
8678
|
-
|
|
8680
|
+
'new' === process.env.RSBUILD_E2E_CACHE && chain.experiments({
|
|
8681
|
+
...chain.get('experiments'),
|
|
8682
|
+
newCache: !0
|
|
8683
|
+
}), cacheEnabled = !0;
|
|
8679
8684
|
let { context } = api, cacheConfig = 'boolean' == typeof buildCache ? {} : buildCache, cacheDirectory = getCacheDirectory(cacheConfig, context), buildDependencies = await getBuildDependencies(context, environment, cacheConfig.buildDependencies), cacheVersion = Array.isArray(cacheConfig.cacheDigest) && cacheConfig.cacheDigest.length ? `${environment.name}-${env}-${await helpers_hash(JSON.stringify(cacheConfig.cacheDigest))}` : `${environment.name}-${env}`;
|
|
8680
8685
|
chain.cache({
|
|
8681
8686
|
type: 'persistent',
|
|
@@ -8718,9 +8723,9 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
8718
8723
|
{
|
|
8719
8724
|
name: 'rsbuild:output',
|
|
8720
8725
|
setup (api) {
|
|
8721
|
-
api.modifyBundlerChain((chain, { CHAIN_ID, isDev, isProd, isServer, environment, rspack, target })=>{
|
|
8726
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID, isDev, isProd, isServer, environment, rspack, target })=>{
|
|
8722
8727
|
var jsAsync;
|
|
8723
|
-
let { distPath, config } = environment, publicPath = getPublicPath({
|
|
8728
|
+
let { distPath, config } = environment, publicPath = await getPublicPath({
|
|
8724
8729
|
config,
|
|
8725
8730
|
isDev,
|
|
8726
8731
|
context: api.context
|
|
@@ -9776,7 +9781,7 @@ try {
|
|
|
9776
9781
|
fileName: manifestOptions.filename,
|
|
9777
9782
|
filter,
|
|
9778
9783
|
writeToFileEmit: isDev && !0 !== writeToDisk,
|
|
9779
|
-
generate: (_seed, files, entries, { compilation })=>{
|
|
9784
|
+
generate: (0, (_seed, files, entries, { compilation })=>{
|
|
9780
9785
|
let chunkEntries = new Map(), filePathByName = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
|
|
9781
9786
|
if (filePathByName.has(file.name) || filePathByName.set(file.name, file.path), file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk)){
|
|
9782
9787
|
let chunkFiles = chunkEntries.get(entryName);
|
|
@@ -9832,7 +9837,7 @@ try {
|
|
|
9832
9837
|
throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
|
|
9833
9838
|
}
|
|
9834
9839
|
return environment.manifest = manifestData, manifestData;
|
|
9835
|
-
}
|
|
9840
|
+
})
|
|
9836
9841
|
};
|
|
9837
9842
|
manifestOptions.prefix || (pluginOptions.publicPath = ''), chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
|
|
9838
9843
|
pluginOptions
|
|
@@ -9977,6 +9982,14 @@ async function createRsbuild(options = {}) {
|
|
|
9977
9982
|
...'boolean' == typeof options.loadEnv ? {} : options.loadEnv
|
|
9978
9983
|
}) : null, configOrFactory = options.config ?? options.rsbuildConfig, config = isFunction(configOrFactory) ? await configOrFactory() : configOrFactory;
|
|
9979
9984
|
isLoadConfigResult(config) && (loadConfigResult = config, config = config.content), config ||= {};
|
|
9985
|
+
let e2eCache = process.env.RSBUILD_E2E_CACHE;
|
|
9986
|
+
('new' === e2eCache || 'legacy' === e2eCache) && config.performance?.buildCache === void 0 && (config = {
|
|
9987
|
+
...config,
|
|
9988
|
+
performance: {
|
|
9989
|
+
...config.performance,
|
|
9990
|
+
buildCache: !0
|
|
9991
|
+
}
|
|
9992
|
+
});
|
|
9980
9993
|
let logger = config.customLogger ?? logger_createLogger({
|
|
9981
9994
|
...src_logger.options,
|
|
9982
9995
|
level: src_logger.level
|
|
@@ -10419,7 +10432,7 @@ let applyServerOptions = (command)=>{
|
|
|
10419
10432
|
};
|
|
10420
10433
|
function setupCommands(argv) {
|
|
10421
10434
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
10422
|
-
cli.version("2.3.
|
|
10435
|
+
cli.version("2.3.2"), 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)', {
|
|
10423
10436
|
default: 'auto'
|
|
10424
10437
|
}).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', {
|
|
10425
10438
|
type: [
|
|
@@ -10484,7 +10497,7 @@ function setupCommands(argv) {
|
|
|
10484
10497
|
}
|
|
10485
10498
|
function showGreeting() {
|
|
10486
10499
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
10487
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.3.
|
|
10500
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.3.2\n`);
|
|
10488
10501
|
}
|
|
10489
10502
|
function setupLogLevel(argv) {
|
|
10490
10503
|
if (argv.length <= 3) return;
|
|
@@ -10506,5 +10519,5 @@ function runCLI({ argv = process.argv } = {}) {
|
|
|
10506
10519
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
10507
10520
|
}
|
|
10508
10521
|
}
|
|
10509
|
-
let src_version = "2.3.
|
|
10522
|
+
let src_version = "2.3.2";
|
|
10510
10523
|
export { core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger_createLogger as createLogger, mergeRsbuildConfig, mrmime_lookup, runCLI, src_logger as logger, src_version as version };
|
package/dist/manifest-plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as s}from"node:module";let r=s(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let s=r("node:path");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,r)=>{let n;return(r[t.name]?n=r[t.name]:t.info.sourceFilename&&(n=(0,s.join)((0,s.dirname)(t.name),(0,s.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,r,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,s.basename)(e),path:e}}),Array.from(t.files).reduce((e,s)=>{let n=t.name?t.name:null;return n=n?r.useEntryKeys&&!s.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(s,r)}`:s,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:s})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/hooks.js"(t,s){s.getCompilerHooks=s.emitHook=s.beforeRunHook=void 0;let n=r("node:fs"),o=r("node:path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,p=e=>{let t=l.get(e);return void 0===t&&(t={afterEmit:new a.SyncWaterfallHook(["manifest"]),beforeEmit:new a.SyncWaterfallHook(["manifest"])},l.set(e,t)),t};s.getCompilerHooks=p,s.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},s.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:r,moduleAssets:a,options:l},c){let h=t.get(r)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==l.publicPath?l.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:d,removeKeyHash:m}=l;t.set(r,h);let k={},y=Array.from(c.chunks).reduce((e,t)=>(0,i.reduceChunk)(e,t,l,k),[]);(y=(y=u.assets.reduce((e,t)=>(0,i.reduceAssets)(e,t,a),y)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,o.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete k[e.path]}),Object.keys(k).forEach(e=>{y=y.concat(k[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),y=y.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:d?t(d)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=m?s.name.replace(m,""):s.name,Object.assign(e,s)}),y=(0,i.transformFiles)(y,l);let _=(0,i.generateManifest)(c,y,l),b=0===h;if(_=p(e).beforeEmit.call(_),b){let t=l.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}p(e).afterEmit.call(_)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/index.js"(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.RspackManifestPlugin=s.WebpackManifestPlugin=s.getCompilerHooks=void 0;let n=r("node:path"),o=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/hooks.js");Object.defineProperty(s,"getCompilerHooks",{enumerable:!0,get:function(){return o.getCompilerHooks}});let a=new Map,i={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};class l{options;constructor(e){this.options=Object.assign({},i,e)}apply(e){let t=(0,n.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,n.relative)(e.options.output?.path||"./",t),r=o.beforeRunHook.bind(this,{emitCountMap:a,manifestFileName:t}),i=o.emitHook.bind(this,{compiler:e,emitCountMap:a,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,r),e.hooks.watchRun.tapAsync(l,r)}}s.WebpackManifestPlugin=l,s.RspackManifestPlugin=l},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_tapsInAllStages(){let e=this._allStageTaps;if(void 0!==e&&e.source===this.taps&&e.length===this.taps.length)return e.taps;let t=this.queryStageRange(a).tapsInRange;return this._allStageTaps={source:this.taps,length:this.taps.length,taps:t},t}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),n(this,"_allStageTaps",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[],this._allStageTaps=void 0}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++)t[e].fn(...s)}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);if(void 0!==r)return r}}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);void 0!==r&&(s[0]=r)}}catch(e){if(e)throw e;return}return s[0]}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)},p=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e?p(e):c===r.length?i():h()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(c=r.length,l(e)):(c+=1,void 0!==t?p(t):c===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,c=r.length,l(e)}s||(c+=1,void 0!==t?p(t):c===r.length?i():h())}if(c===r.length)return};h()}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let d=(e,t)=>t;class m{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:d},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new k(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class k{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class y{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new y(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var S in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>g,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>f,HookBase:()=>o,HookMap:()=>m,MultiHook:()=>y,QueriedHook:()=>i,QueriedHookMap:()=>k,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(S)&&(t[S]=r[S]);Object.defineProperty(t,"__esModule",{value:!0})}});let n=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/962a610493ec402e318fb90e15abdb8e0c048f9453227ea9c1af410588c46571/node_modules/rspack-manifest-plugin/dist/index.js");var o=n.RspackManifestPlugin,a=n.WebpackManifestPlugin,i=n.__esModule,l=n.getCompilerHooks;export{o as RspackManifestPlugin,a as WebpackManifestPlugin,i as __esModule,l as getCompilerHooks};
|
|
1
|
+
import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as s}from"node:module";let r=s(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let s=r("node:path");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,r)=>{let n;return(r[t.name]?n=r[t.name]:t.info.sourceFilename&&(n=(0,s.join)((0,s.dirname)(t.name),(0,s.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,r,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,s.basename)(e),path:e}}),Array.from(t.files).reduce((e,s)=>{let n=t.name?t.name:null;return n=n?r.useEntryKeys&&!s.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(s,r)}`:s,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:s})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/hooks.js"(t,s){s.getCompilerHooks=s.emitHook=s.beforeRunHook=void 0;let n=r("node:fs"),o=r("node:path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/helpers.js"),l=new WeakMap,p=e=>{let t=l.get(e);return void 0===t&&(t={afterEmit:new a.SyncWaterfallHook(["manifest"]),beforeEmit:new a.SyncWaterfallHook(["manifest"])},l.set(e,t)),t};s.getCompilerHooks=p,s.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},s.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:r,moduleAssets:a,options:l},c){let h=t.get(r)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),f=null!==l.publicPath?l.publicPath:u.publicPath,g="auto"===f?"":f,{basePath:d,removeKeyHash:m}=l;t.set(r,h);let k={},y=Array.from(c.chunks).reduce((e,t)=>(0,i.reduceChunk)(e,t,l,k),[]);(y=(y=u.assets.reduce((e,t)=>(0,i.reduceAssets)(e,t,a),y)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,o.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete k[e.path]}),Object.keys(k).forEach(e=>{y=y.concat(k[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),y=y.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:d?t(d)+e.name:e.name,path:g?t(g)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=m?s.name.replace(m,""):s.name,Object.assign(e,s)}),y=(0,i.transformFiles)(y,l);let _=(0,i.generateManifest)(c,y,l),b=0===h;if(_=p(e).beforeEmit.call(_),b){let t=l.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),l.writeToFileEmit&&((0,n.mkdirSync)((0,o.dirname)(r),{recursive:!0}),(0,n.writeFileSync)(r,t))}p(e).afterEmit.call(_)}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/index.js"(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.RspackManifestPlugin=s.WebpackManifestPlugin=s.getCompilerHooks=void 0;let n=r("node:path"),o=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/hooks.js");Object.defineProperty(s,"getCompilerHooks",{enumerable:!0,get:function(){return o.getCompilerHooks}});let a=new Map,i={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};class l{options;constructor(e){this.options=Object.assign({},i,e)}apply(e){let t=(0,n.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,n.relative)(e.options.output?.path||"./",t),r=o.beforeRunHook.bind(this,{emitCountMap:a,manifestFileName:t}),i=o.emitHook.bind(this,{compiler:e,emitCountMap:a,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,r),e.hooks.watchRun.tapAsync(l,r)}}s.WebpackManifestPlugin=l,s.RspackManifestPlugin=l},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@rspack/lite-tapable/1.3.0/d8e32e7fb817cdfb41451d9864cce72487f9f1c5d0692c56b215ca9a32edc726/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_tapsInAllStages(){let e=this._allStageTaps;if(void 0!==e&&e.source===this.taps&&e.length===this.taps.length)return e.taps;let t=this.queryStageRange(a).tapsInRange;return this._allStageTaps={source:this.taps,length:this.taps.length,taps:t},t}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),n(this,"_allStageTaps",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[],this._allStageTaps=void 0}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++)t[e].fn(...s)}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);if(void 0!==r)return r}}catch(e){if(e)throw e}}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){if(this.interceptors.length>0)return this.callStageRange(this.queryStageRange(a),...e);let t=this._tapsInAllStages(),s=this._prepareArgs(e);try{for(let e=0;e<t.length;e++){let r=t[e].fn(...s);void 0!==r&&(s[0]=r)}}catch(e){if(e)throw e;return}return s[0]}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class 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=()=>{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 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=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let d=(e,t)=>t;class m{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:d},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new k(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class k{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class y{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new y(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var S in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>f,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>g,HookBase:()=>o,HookMap:()=>m,MultiHook:()=>y,QueriedHook:()=>i,QueriedHookMap:()=>k,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(S)&&(t[S]=r[S]);Object.defineProperty(t,"__esModule",{value:!0})}});let n=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/7effcc0bb8833fe538e43fc501c2e2f26971eb61bf9b4827f15ff72c12352aed/node_modules/rspack-manifest-plugin/dist/index.js");var o=n.RspackManifestPlugin,a=n.WebpackManifestPlugin,i=n.__esModule,l=n.getCompilerHooks;export{o as RspackManifestPlugin,a as WebpackManifestPlugin,i as __esModule,l as getCompilerHooks};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { InternalContext, RequestHandler, Rspack } from '../../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Filters environments to those whose outputs may be exposed by the HTTP assets
|
|
4
|
-
* middleware. Node-targeted outputs are intended for server-side execution,
|
|
5
|
-
* such as through `loadBundle`, and must not participate in URL resolution.
|
|
6
|
-
*/ export declare const filterWebEnvironments: (environmentList: InternalContext['environmentList']) => InternalContext['environmentList'];
|
|
7
2
|
export declare function createAssetsMiddleware(context: InternalContext, { waitForAssets, waitForBuild }: {
|
|
8
3
|
waitForAssets: (callback: () => void) => void;
|
|
9
4
|
waitForBuild: (callback: () => void) => void;
|