@rsbuild/core 2.1.9 → 2.1.10
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/postcss/index.js +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +7 -11
- package/dist/626.js +92 -76
- package/dist/manifest-plugin.js +1 -1
- package/dist/server/helper.d.ts +6 -8
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"postcss","author":"Andrey Sitnik <andrey@sitnik.es>","version":"8.5.
|
|
1
|
+
{"name":"postcss","author":"Andrey Sitnik <andrey@sitnik.es>","version":"8.5.25","funding":[{"type":"opencollective","url":"https://opencollective.com/postcss/"},{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/postcss"},{"type":"github","url":"https://github.com/sponsors/ai"}],"license":"MIT","types":"./lib/postcss.d.ts","type":"commonjs"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
391: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(545)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
545: (__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__(452);
|
|
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
|
+
452: (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__(391);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rspack-chain","version":"2.1.
|
|
1
|
+
{"name":"rspack-chain","version":"2.1.2","license":"MIT","types":"types/index.d.ts","type":"module"}
|
|
@@ -63,13 +63,13 @@ export declare class RspackChain extends __Config.ChainedMap<void> {
|
|
|
63
63
|
>;
|
|
64
64
|
output: RspackChain.Output;
|
|
65
65
|
module: RspackChain.Module;
|
|
66
|
-
node: RspackChain.ChainedMap<this> & ((value:
|
|
66
|
+
node: RspackChain.ChainedMap<this> & ((value: false) => this);
|
|
67
67
|
optimization: RspackChain.Optimization;
|
|
68
|
-
performance: RspackChain.Performance & ((value:
|
|
68
|
+
performance: RspackChain.Performance & ((value: false) => this);
|
|
69
69
|
plugins: RspackChain.Plugins<this, PluginInstance>;
|
|
70
70
|
resolve: RspackChain.Resolve;
|
|
71
71
|
resolveLoader: RspackChain.ResolveLoader;
|
|
72
|
-
devServer: RspackChain.DevServer;
|
|
72
|
+
devServer: RspackChain.DevServer & ((value: false) => this);
|
|
73
73
|
|
|
74
74
|
context(value: RspackConfig['context']): this;
|
|
75
75
|
mode(value: RspackConfig['mode']): this;
|
|
@@ -272,8 +272,9 @@ export declare namespace RspackChain {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
type RspackResolve = Required<NonNullable<Configuration['resolve']>>;
|
|
275
|
+
type RspackResolveAlias = Exclude<RspackResolve['alias'], false>;
|
|
275
276
|
class Resolve<T = RspackChain> extends ChainedMap<T> {
|
|
276
|
-
alias: TypedChainedMap<this,
|
|
277
|
+
alias: TypedChainedMap<this, RspackResolveAlias>;
|
|
277
278
|
aliasFields: TypedChainedSet<this, RspackResolve['aliasFields'][number]>;
|
|
278
279
|
conditionNames: TypedChainedSet<
|
|
279
280
|
this,
|
|
@@ -298,10 +299,7 @@ export declare namespace RspackChain {
|
|
|
298
299
|
restrictions: TypedChainedSet<this, RspackResolve['restrictions'][number]>;
|
|
299
300
|
roots: TypedChainedSet<this, RspackResolve['roots'][number]>;
|
|
300
301
|
modules: TypedChainedSet<this, RspackResolve['modules'][number]>;
|
|
301
|
-
fallback: TypedChainedMap<
|
|
302
|
-
this,
|
|
303
|
-
{ [key: string]: string | false | string[] }
|
|
304
|
-
>;
|
|
302
|
+
fallback: TypedChainedMap<this, RspackResolveAlias>;
|
|
305
303
|
byDependency: TypedChainedMap<this, RspackResolve['byDependency']>;
|
|
306
304
|
enforceExtension(value: RspackResolve['enforceExtension']): this;
|
|
307
305
|
fullySpecified(value: RspackResolve['fullySpecified']): this;
|
|
@@ -400,9 +398,7 @@ export declare namespace RspackChain {
|
|
|
400
398
|
[name: string]: any;
|
|
401
399
|
}
|
|
402
400
|
|
|
403
|
-
|
|
404
|
-
[name: string]: any;
|
|
405
|
-
}
|
|
401
|
+
type LoaderOptions = NonNullable<RuleSetLoaderWithOptions['options']>;
|
|
406
402
|
|
|
407
403
|
type LoaderParallelOptions = NonNullable<
|
|
408
404
|
RuleSetLoaderWithOptions['parallel']
|
package/dist/626.js
CHANGED
|
@@ -386,8 +386,8 @@ __webpack_require__.add({
|
|
|
386
386
|
return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
|
|
387
387
|
}
|
|
388
388
|
},
|
|
389
|
-
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
390
|
-
let yaml, { resolve } = __webpack_require__("node:path?815c"), config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
389
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
390
|
+
let yaml, { resolve } = __webpack_require__("node:path?815c"), config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/options.js"), loadPlugins = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/plugins.js"), req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/req.js");
|
|
391
391
|
async function processResult(ctx, result) {
|
|
392
392
|
let obj, file = result.filepath || '', projectConfig = ((obj = result.config) && obj.__esModule ? obj : {
|
|
393
393
|
default: obj
|
|
@@ -460,8 +460,8 @@ __webpack_require__.add({
|
|
|
460
460
|
});
|
|
461
461
|
};
|
|
462
462
|
},
|
|
463
|
-
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
464
|
-
let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
463
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/options.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
464
|
+
let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/req.js");
|
|
465
465
|
module.exports = async function options(config, file) {
|
|
466
466
|
if (config.parser && 'string' == typeof config.parser) try {
|
|
467
467
|
config.parser = await req(config.parser, file);
|
|
@@ -481,8 +481,8 @@ __webpack_require__.add({
|
|
|
481
481
|
return config;
|
|
482
482
|
};
|
|
483
483
|
},
|
|
484
|
-
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
485
|
-
let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
484
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/plugins.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
485
|
+
let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/req.js");
|
|
486
486
|
async function load(plugin, options, file) {
|
|
487
487
|
try {
|
|
488
488
|
if (null == options || 0 === Object.keys(options).length) return await req(plugin, file);
|
|
@@ -498,7 +498,7 @@ __webpack_require__.add({
|
|
|
498
498
|
}), list;
|
|
499
499
|
};
|
|
500
500
|
},
|
|
501
|
-
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
501
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/req.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
502
502
|
let tsx, jiti, { createRequire } = __webpack_require__("node:module?f56b"), { pathToFileURL } = __webpack_require__("node:url?5295"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
|
|
503
503
|
module.exports = async function req(name, rootFile = __rspack_import_meta_filename__) {
|
|
504
504
|
let url = createRequire(rootFile).resolve(name);
|
|
@@ -1798,7 +1798,7 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
|
|
|
1798
1798
|
'clean'
|
|
1799
1799
|
]);
|
|
1800
1800
|
}
|
|
1801
|
-
}, DevServer = class extends
|
|
1801
|
+
}, DevServer = class extends ChainedValueMap {
|
|
1802
1802
|
constructor(parent){
|
|
1803
1803
|
super(parent), this.extend([
|
|
1804
1804
|
'allowedHosts',
|
|
@@ -1825,7 +1825,8 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
|
|
|
1825
1825
|
]);
|
|
1826
1826
|
}
|
|
1827
1827
|
toConfig() {
|
|
1828
|
-
|
|
1828
|
+
let config = this.entries();
|
|
1829
|
+
return !1 !== config && this.clean(config || {});
|
|
1829
1830
|
}
|
|
1830
1831
|
}, Orderable = (Class)=>class extends Class {
|
|
1831
1832
|
before(name) {
|
|
@@ -2152,6 +2153,10 @@ class RspackChain extends ChainedMap {
|
|
|
2152
2153
|
entryImport.push(item);
|
|
2153
2154
|
continue;
|
|
2154
2155
|
}
|
|
2156
|
+
if (Array.isArray(item)) {
|
|
2157
|
+
entryImport.push(...item);
|
|
2158
|
+
continue;
|
|
2159
|
+
}
|
|
2155
2160
|
item.import && entryImport.push(...castArray(item.import)), entryDescription ? Object.assign(entryDescription, item) : entryDescription = item;
|
|
2156
2161
|
}
|
|
2157
2162
|
formattedEntry[entryName] = entryDescription ? {
|
|
@@ -3407,7 +3412,7 @@ function createPublicContext(context) {
|
|
|
3407
3412
|
async function createContext(options, userConfig, logger, loadConfigResult) {
|
|
3408
3413
|
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();
|
|
3409
3414
|
return {
|
|
3410
|
-
version: "2.1.
|
|
3415
|
+
version: "2.1.10",
|
|
3411
3416
|
rootPath,
|
|
3412
3417
|
configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
|
|
3413
3418
|
configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
|
|
@@ -5028,7 +5033,7 @@ function parseMinifyOptions(config) {
|
|
|
5028
5033
|
cssOptions: minify.cssOptions
|
|
5029
5034
|
};
|
|
5030
5035
|
}
|
|
5031
|
-
let postcss_load_config_src = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
5036
|
+
let postcss_load_config_src = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.25/node_modules/postcss-load-config/src/index.js");
|
|
5032
5037
|
var postcss_load_config_src_default = __webpack_require__.n(postcss_load_config_src);
|
|
5033
5038
|
async function getLightningCSSLoaderOptions(config, targets, minify) {
|
|
5034
5039
|
let userOptions = 'object' == typeof config.tools.lightningcssLoader ? config.tools.lightningcssLoader : {}, initialOptions = {
|
|
@@ -5316,9 +5321,9 @@ async function printFileSizes(options, stats, rootPath, distPath, environmentNam
|
|
|
5316
5321
|
}, getAssets = async ()=>{
|
|
5317
5322
|
let { exclude, include } = options, formattedAssets = [], compilationAssets = stats.compilation.assets;
|
|
5318
5323
|
for (let assetName of Object.keys(compilationAssets)){
|
|
5319
|
-
let
|
|
5324
|
+
let filePath = getFilePath(assetName);
|
|
5320
5325
|
if (!exclude && EXCLUDE_ASSET_REGEX.test(filePath)) continue;
|
|
5321
|
-
let content = options.compressed && isCompressible(filePath) ? value.source() : void 0, size = void 0 === content ? value.size() : Buffer.byteLength(content);
|
|
5326
|
+
let value = compilationAssets[assetName], content = options.compressed && isCompressible(filePath) ? value.source() : void 0, size = void 0 === content ? value.size() : Buffer.byteLength(content);
|
|
5322
5327
|
if (exclude || include) {
|
|
5323
5328
|
let publicAsset = {
|
|
5324
5329
|
name: filePath,
|
|
@@ -5467,8 +5472,8 @@ class RsbuildHtmlPlugin {
|
|
|
5467
5472
|
}
|
|
5468
5473
|
apply(compiler) {
|
|
5469
5474
|
let emitFavicon = async ({ compilation, favicon, faviconDistPath, logger })=>{
|
|
5470
|
-
let fileContent, name = node_path.basename(favicon);
|
|
5471
|
-
if (compilation.assets
|
|
5475
|
+
let fileContent, name = node_path.basename(favicon), outputFilename = node_path.posix.join(faviconDistPath, name);
|
|
5476
|
+
if (outputFilename in compilation.assets) return outputFilename;
|
|
5472
5477
|
let inputFs = compilation.inputFileSystem;
|
|
5473
5478
|
if (!inputFs) return addCompilationError(compilation, `${color.dim('[rsbuild:html]')} Failed to read the favicon file as ${color.yellow('compilation.inputFileSystem')} is not available.`), null;
|
|
5474
5479
|
let inputFilename = node_path.isAbsolute(favicon) ? favicon : node_path.join(compilation.compiler.context, favicon);
|
|
@@ -5477,7 +5482,7 @@ class RsbuildHtmlPlugin {
|
|
|
5477
5482
|
} catch (error) {
|
|
5478
5483
|
return logger.debug(`read favicon error: ${error}`), addCompilationError(compilation, `${color.dim('[rsbuild:html]')} Failed to read the favicon file at ${color.yellow(inputFilename)}.`), null;
|
|
5479
5484
|
}
|
|
5480
|
-
let source = new core_rspack.sources.RawSource(fileContent, !1)
|
|
5485
|
+
let source = new core_rspack.sources.RawSource(fileContent, !1);
|
|
5481
5486
|
return compilation.emitAsset(outputFilename, source), outputFilename;
|
|
5482
5487
|
}, addFavicon = async ({ headTags, favicon, faviconDistPath, compilation, publicPath, logger })=>{
|
|
5483
5488
|
let href = favicon;
|
|
@@ -5713,11 +5718,12 @@ function updateSourceMappingURL({ source, compilation, publicPath, type, config
|
|
|
5713
5718
|
}
|
|
5714
5719
|
return source;
|
|
5715
5720
|
}
|
|
5716
|
-
function
|
|
5717
|
-
|
|
5721
|
+
function getMatchedAsset(name, assets, tests) {
|
|
5722
|
+
let asset;
|
|
5723
|
+
if (tests.some((test)=>isFunction(test) ? !!(asset ??= assets[name]) && test({
|
|
5718
5724
|
name,
|
|
5719
5725
|
size: asset.size()
|
|
5720
|
-
}) : test.exec(name));
|
|
5726
|
+
}) : test.exec(name))) return asset ?? assets[name];
|
|
5721
5727
|
}
|
|
5722
5728
|
function getInlineTests(config) {
|
|
5723
5729
|
let isProd = 'production' === config.mode, { inlineStyles, inlineScripts } = config.output, scriptTests = [], styleTests = [];
|
|
@@ -5753,19 +5759,31 @@ let normalizeUrl = (url)=>url.replace(/([^:]\/)\/+/g, '$1'), formatPrefix = (inp
|
|
|
5753
5759
|
entryName,
|
|
5754
5760
|
pathname: prefix + ('index' === entryName && 'nested' !== outputStructure ? '' : entryName)
|
|
5755
5761
|
})).sort((a)=>'index' === a.entryName ? -1 : 1);
|
|
5756
|
-
};
|
|
5762
|
+
}, formatName = (name)=>name ? `(${name.length > 20 ? `${name.slice(0, 19)}…` : name})` : name;
|
|
5757
5763
|
function getURLMessages(urls, routes, { maxRoutes = 10, showAllRoutes, cliShortcutsEnabled }) {
|
|
5758
|
-
let routeLimit = showAllRoutes ? 1 / 0 : void 0 === maxRoutes ? 10 : maxRoutes === 1 / 0 ? maxRoutes : Math.max(0, Math.floor(maxRoutes)), printableRoutes = 0 === routeLimit ? [] : routes.slice(0, routeLimit), moreEntries = routeLimit > 0 ? routes.length - printableRoutes.length : 0;
|
|
5764
|
+
let prevName, routeLimit = showAllRoutes ? 1 / 0 : void 0 === maxRoutes ? 10 : maxRoutes === 1 / 0 ? maxRoutes : Math.max(0, Math.floor(maxRoutes)), printableRoutes = 0 === routeLimit ? [] : routes.slice(0, routeLimit), moreEntries = routeLimit > 0 ? routes.length - printableRoutes.length : 0, nameCount = 0;
|
|
5765
|
+
for (let { name } of urls)if (name && ++nameCount > 1) break;
|
|
5766
|
+
let showNames = nameCount > 1;
|
|
5759
5767
|
if (routes.length <= 1 || 0 === printableRoutes.length) {
|
|
5760
|
-
let pathname = printableRoutes
|
|
5761
|
-
|
|
5762
|
-
|
|
5768
|
+
let pathname = printableRoutes[0]?.pathname ?? '', items = urls.map(({ label, name, url })=>({
|
|
5769
|
+
label,
|
|
5770
|
+
name: showNames ? formatName(name) : void 0,
|
|
5771
|
+
url: normalizeUrl(`${url}${pathname}`)
|
|
5772
|
+
})), labelWidth = Math.max(10, ...items.map((item)=>item.label.trimEnd().length + 2)), urlWidth = Math.max(0, ...items.map((item)=>item.name ? item.url.length : 0)), message = items.map(({ label, name, url })=>{
|
|
5773
|
+
let prefix = `➜ ${color.dim(label.trimEnd().padEnd(labelWidth))}`, suffix = name ? `${' '.repeat(urlWidth - url.length + 2)}${color.dim(name)}` : '';
|
|
5774
|
+
return ` ${prefix}${color.cyan(url)}${suffix}\n`;
|
|
5763
5775
|
}).join('');
|
|
5764
5776
|
return moreEntries > 0 && (message += getMoreEntriesMessage(moreEntries, cliShortcutsEnabled)), message;
|
|
5765
5777
|
}
|
|
5766
|
-
let message = '', prevLabel = '',
|
|
5767
|
-
return urls.forEach(({ label, url }, index)=>{
|
|
5768
|
-
|
|
5778
|
+
let message = '', prevLabel = '', entryWidth = Math.max(...printableRoutes.map((route)=>route.entryName.length));
|
|
5779
|
+
return urls.forEach(({ label, name, url }, index)=>{
|
|
5780
|
+
let shortName = showNames ? formatName(name) : void 0;
|
|
5781
|
+
if (prevLabel !== label || prevName !== shortName) {
|
|
5782
|
+
index > 0 && (message += '\n');
|
|
5783
|
+
let title = shortName ? `${label.trimEnd().slice(0, -1)} ${color.dim(shortName)}:` : label;
|
|
5784
|
+
message += ` ➜ ${title}\n`, prevLabel = label, prevName = shortName;
|
|
5785
|
+
}
|
|
5786
|
+
for (let { entryName, pathname } of printableRoutes)message += ` ${color.dim('-')} ${color.dim(entryName.padEnd(entryWidth + 4))}${color.cyan(normalizeUrl(`${url}${pathname}`))}\n`;
|
|
5769
5787
|
}), moreEntries > 0 && (message += getMoreEntriesMessage(moreEntries, cliShortcutsEnabled)), message;
|
|
5770
5788
|
}
|
|
5771
5789
|
function printServerURLs({ urls: originalUrls, port, routes, protocol, printUrls, fallbackPathname, showAllRoutes, cliShortcutsEnabled, originalConfig, logger }) {
|
|
@@ -5835,12 +5853,16 @@ let getPort = async ({ host, port, strictPort, tryLimits = 20 })=>{
|
|
|
5835
5853
|
port,
|
|
5836
5854
|
portTip
|
|
5837
5855
|
};
|
|
5838
|
-
},
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5856
|
+
}, WILDCARD_HOSTS = new Set([
|
|
5857
|
+
ALL_INTERFACES_IPV4,
|
|
5858
|
+
'::',
|
|
5859
|
+
'0000:0000:0000:0000:0000:0000:0000:0000'
|
|
5860
|
+
]), LOOPBACK_HOSTS = new Set([
|
|
5861
|
+
LOCALHOST,
|
|
5862
|
+
'127.0.0.1',
|
|
5863
|
+
'::1',
|
|
5864
|
+
'0000:0000:0000:0000:0000:0000:0000:0001'
|
|
5865
|
+
]), isLoopbackHost = (host)=>LOOPBACK_HOSTS.has(host), getHostInUrl = async (host)=>{
|
|
5844
5866
|
if (host === ALL_INTERFACES_IPV4 || host === LOCALHOST) return LOCALHOST;
|
|
5845
5867
|
let { isIPv6 } = await import("node:net");
|
|
5846
5868
|
return isIPv6(host) ? '::' === host ? '[::1]' : `[${host}]` : host;
|
|
@@ -5865,33 +5887,27 @@ let getPort = async ({ host, port, strictPort, tryLimits = 20 })=>{
|
|
|
5865
5887
|
}
|
|
5866
5888
|
];
|
|
5867
5889
|
}
|
|
5868
|
-
let
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
detail.family !== familyV4Value || ipv4Interfaces.has(detail.address) || ipv4Interfaces.set(detail.address, detail);
|
|
5873
|
-
}
|
|
5874
|
-
return Array.from(ipv4Interfaces.values());
|
|
5875
|
-
})(), addressUrls = [], hasLocalUrl = !1;
|
|
5876
|
-
for (let detail of ipv4Interfaces)if (isLoopbackHost(detail.address) || detail.internal) {
|
|
5877
|
-
if (hasLocalUrl) continue;
|
|
5878
|
-
addressUrls.push({
|
|
5890
|
+
let urls = [], seen = new Set(), hasLocal = !1;
|
|
5891
|
+
for (let [name, infos] of Object.entries(node_os.networkInterfaces()))for (let info of infos ?? []){
|
|
5892
|
+
let family = info.family;
|
|
5893
|
+
!('IPv4' !== family && 4 !== family || seen.has(info.address)) && (seen.add(info.address), isLoopbackHost(info.address) || info.internal ? hasLocal || (urls.push({
|
|
5879
5894
|
label: LOCAL_LABEL,
|
|
5880
5895
|
url: concatUrl({
|
|
5881
5896
|
host: LOCALHOST,
|
|
5882
5897
|
port,
|
|
5883
5898
|
protocol
|
|
5884
5899
|
})
|
|
5885
|
-
}),
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5900
|
+
}), hasLocal = !0) : urls.push({
|
|
5901
|
+
label: NETWORK_LABEL,
|
|
5902
|
+
name,
|
|
5903
|
+
url: concatUrl({
|
|
5904
|
+
host: info.address,
|
|
5905
|
+
port,
|
|
5906
|
+
protocol
|
|
5907
|
+
})
|
|
5908
|
+
}));
|
|
5909
|
+
}
|
|
5910
|
+
return urls;
|
|
5895
5911
|
};
|
|
5896
5912
|
function getServerTerminator(server) {
|
|
5897
5913
|
let listened = !1, pendingSockets = new Set(), onConnection = (socket)=>{
|
|
@@ -6512,11 +6528,7 @@ async function resolveHostname(host = LOCALHOST) {
|
|
|
6512
6528
|
let resolvedAddress = await getLocalhostResolvedAddress();
|
|
6513
6529
|
if (resolvedAddress) return resolvedAddress;
|
|
6514
6530
|
}
|
|
6515
|
-
return void 0 === host ||
|
|
6516
|
-
ALL_INTERFACES_IPV4,
|
|
6517
|
-
'::',
|
|
6518
|
-
'0000:0000:0000:0000:0000:0000:0000:0000'
|
|
6519
|
-
]).has(host) ? LOCALHOST : host;
|
|
6531
|
+
return void 0 === host || WILDCARD_HOSTS.has(host) ? LOCALHOST : host;
|
|
6520
6532
|
}
|
|
6521
6533
|
let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
6522
6534
|
async function getFileFromUrl(url, outputFileSystem, context) {
|
|
@@ -9025,14 +9037,14 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
9025
9037
|
'node'
|
|
9026
9038
|
],
|
|
9027
9039
|
raw: !0
|
|
9028
|
-
}, ({ code, emitFile, resourcePath })=>{
|
|
9040
|
+
}, ({ code, emitFile, environment, resourcePath })=>{
|
|
9029
9041
|
let name, filename = (name = resourcePath && node_path.parse(resourcePath).name) ? `${name}.node` : null;
|
|
9030
9042
|
if (null === filename) throw Error(`${color.dim('[rsbuild:nodeAddons]')} Failed to load Node.js addon: ${color.yellow(resourcePath)}`);
|
|
9031
9043
|
emitFile(filename, code);
|
|
9032
|
-
let
|
|
9044
|
+
let handleErrorSnippet = `throw new Error('Failed to load Node.js addon: "${filename}"', {
|
|
9033
9045
|
cause: error,
|
|
9034
9046
|
});`;
|
|
9035
|
-
return config.output.module ? `
|
|
9047
|
+
return environment.config.output.module ? `
|
|
9036
9048
|
import path from "node:path";
|
|
9037
9049
|
import { createRequire } from "node:module";
|
|
9038
9050
|
import { fileURLToPath } from "node:url";
|
|
@@ -9355,12 +9367,16 @@ try {
|
|
|
9355
9367
|
if (!inlinedAssets || 0 === inlinedAssets.size) return;
|
|
9356
9368
|
let { devtool } = compiler.options, hasSourceMap = 'hidden-source-map' !== devtool && !1 !== devtool;
|
|
9357
9369
|
for (let name of inlinedAssets){
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9370
|
+
if (hasSourceMap) {
|
|
9371
|
+
let asset = compilation.assets[name];
|
|
9372
|
+
if (!asset) continue;
|
|
9373
|
+
compilation.updateAsset(name, asset, {
|
|
9374
|
+
related: {
|
|
9375
|
+
sourceMap: null
|
|
9376
|
+
}
|
|
9377
|
+
});
|
|
9378
|
+
} else if (!(name in compilation.assets)) continue;
|
|
9379
|
+
compilation.deleteAsset(name);
|
|
9364
9380
|
}
|
|
9365
9381
|
inlinedAssets.clear();
|
|
9366
9382
|
}), api.modifyHTMLTags(({ headTags, bodyTags }, { compiler, compilation, environment })=>{
|
|
@@ -9380,8 +9396,8 @@ try {
|
|
|
9380
9396
|
return config = environment.config, "script" === tag.tag ? ((publicPath, tag, compilation, inlinedAssets, scriptTests, config)=>{
|
|
9381
9397
|
let { assets } = compilation;
|
|
9382
9398
|
if (!(tag.attrs?.src && 'string' == typeof tag.attrs.src)) return tag;
|
|
9383
|
-
let { src, ...otherAttrs } = tag.attrs, scriptName = publicPath ? src.replace(publicPath, '') : src, asset = assets
|
|
9384
|
-
if (
|
|
9399
|
+
let { src, ...otherAttrs } = tag.attrs, scriptName = publicPath ? src.replace(publicPath, '') : src, asset = getMatchedAsset(scriptName, assets, scriptTests);
|
|
9400
|
+
if (!asset) return tag;
|
|
9385
9401
|
let ret = {
|
|
9386
9402
|
tag: "script",
|
|
9387
9403
|
children: updateSourceMappingURL({
|
|
@@ -9399,8 +9415,8 @@ try {
|
|
|
9399
9415
|
})(publicPath, tag, compilation, inlinedAssets, scriptTests, config) : 'link' === tag.tag && tag.attrs && 'stylesheet' === tag.attrs.rel ? ((publicPath, tag, compilation, inlinedAssets, styleTests, config)=>{
|
|
9400
9416
|
let { assets } = compilation;
|
|
9401
9417
|
if (!(tag.attrs?.href && 'string' == typeof tag.attrs.href)) return tag;
|
|
9402
|
-
let linkName = publicPath ? tag.attrs.href.replace(publicPath, '') : tag.attrs.href, asset = assets
|
|
9403
|
-
if (
|
|
9418
|
+
let linkName = publicPath ? tag.attrs.href.replace(publicPath, '') : tag.attrs.href, asset = getMatchedAsset(linkName, assets, styleTests);
|
|
9419
|
+
if (!asset) return tag;
|
|
9404
9420
|
let ret = {
|
|
9405
9421
|
tag: 'style',
|
|
9406
9422
|
children: updateSourceMappingURL({
|
|
@@ -9571,7 +9587,7 @@ try {
|
|
|
9571
9587
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
|
|
9572
9588
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
9573
9589
|
if (!1 === manifest) return;
|
|
9574
|
-
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.1.
|
|
9590
|
+
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.1.8/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
9575
9591
|
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
9576
9592
|
let pluginOptions = {
|
|
9577
9593
|
fileName: manifestOptions.filename,
|
|
@@ -10114,7 +10130,7 @@ let applyServerOptions = (command)=>{
|
|
|
10114
10130
|
};
|
|
10115
10131
|
function setupCommands(argv) {
|
|
10116
10132
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
10117
|
-
cli.version("2.1.
|
|
10133
|
+
cli.version("2.1.10"), 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)', {
|
|
10118
10134
|
default: 'auto'
|
|
10119
10135
|
}).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', {
|
|
10120
10136
|
type: [
|
|
@@ -10179,7 +10195,7 @@ function setupCommands(argv) {
|
|
|
10179
10195
|
}
|
|
10180
10196
|
function showGreeting() {
|
|
10181
10197
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
10182
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.1.
|
|
10198
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.1.10\n`);
|
|
10183
10199
|
}
|
|
10184
10200
|
function setupLogLevel(argv) {
|
|
10185
10201
|
if (argv.length <= 3) return;
|
|
@@ -10201,5 +10217,5 @@ function runCLI({ argv = process.argv } = {}) {
|
|
|
10201
10217
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
10202
10218
|
}
|
|
10203
10219
|
}
|
|
10204
|
-
let src_version = "2.1.
|
|
10220
|
+
let src_version = "2.1.10";
|
|
10205
10221
|
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.1.7/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.7/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.7/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.7/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.7/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.emitHook.bind(this,{compiler:e,emitCountMap:o,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new c(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(l),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(l),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}let a=-1/0,i=1/0,l=[a,1/0],p=0x80000000-1;class c{isUsed(){return!!(this.tapsInRange.length>0||this.stageRange[0]===a&&this.hook.interceptors.some(e=>e.call)||this.stageRange[1]===i&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):o===i&&t===i&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}if(void 0!==t)return this._runResultInterceptors(t),l(null,t)}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{let t=e.fn(...p);void 0!==t&&(p[0]=t)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null,p[0]))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(c-=1)&&l()},e=>{c=0,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=0,p(e)):0==(c-=1)&&l()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=0,p(e)}t||0!=--c||l()}if(c<=0)return}}}class m extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(c+=1)===r.length?l():h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=r.length,p(e)):(c+=1)===r.length?l():h()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l():h())}if(c===r.length)return};h()}}class d extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)},c=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return l();let h=0,u=()=>{let e=r[h];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{h+=1,void 0!==e?c(e):h===r.length?l():u()},e=>{h=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(h=r.length,p(e)):(h+=1,void 0!==t?c(t):h===r.length?l():u())});else{let t,s=!1;try{t=e.fn(...i)}catch(e){s=!0,h=r.length,p(e)}s||(h+=1,void 0!==t?c(t):h===r.length?l():u())}if(h===r.length)return};u()}}class y extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=e=>{this._runResultInterceptors(e),o(null,e)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l(i[0]);let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e&&(i[0]=e),c===r.length?l(i[0]):h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(c=r.length,p(e)):(c+=1,void 0!==t&&(i[0]=t),c===r.length?l(i[0]):h())});else{let t=!1;try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l(i[0]):h())}if(c===r.length)return};h()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let k=(e,t)=>t;class S{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:k},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new _(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class _{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class A{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new A(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var H in s.d(r,{AsyncParallelHook:()=>f,AsyncSeriesBailHook:()=>d,AsyncSeriesHook:()=>m,AsyncSeriesWaterfallHook:()=>y,HookBase:()=>o,HookMap:()=>S,MultiHook:()=>A,QueriedHook:()=>c,QueriedHookMap:()=>_,SyncBailHook:()=>u,SyncHook:()=>h,SyncWaterfallHook:()=>g},{maxStage:i,minStage:a,safeStage:e=>e<-0x80000000?-0x80000000:e>p?p:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(H)&&(t[H]=r[H]);Object.defineProperty(t,"__esModule",{value:!0})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.7/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.1.8/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.8/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.8/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.8/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.8/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.emitHook.bind(this,{compiler:e,emitCountMap:o,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new c(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(l),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(l),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}let a=-1/0,i=1/0,l=[a,1/0],p=0x80000000-1;class c{isUsed(){return!!(this.tapsInRange.length>0||this.stageRange[0]===a&&this.hook.interceptors.some(e=>e.call)||this.stageRange[1]===i&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):o===i&&t===i&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...p)}catch(e){return this._runErrorInterceptors(e),l(e)}if(void 0!==t)return this._runResultInterceptors(t),l(null,t)}r===i&&(this._runDoneInterceptors(),l(null))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),l=t[t.length-1],p=this._prepareArgs(o);for(let e of(s===a&&this._runCallInterceptors(...p),n)){this._runTapInterceptors(e);try{let t=e.fn(...p);void 0!==t&&(p[0]=t)}catch(e){return this._runErrorInterceptors(e),l(e)}}r===i&&(this._runDoneInterceptors(),l(null,p[0]))}call(...e){return this.callStageRange(this.queryStageRange(l),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(c-=1)&&l()},e=>{c=0,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=0,p(e)):0==(c-=1)&&l()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=0,p(e)}t||0!=--c||l()}if(c<=0)return}}}class m extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(c+=1)===r.length?l():h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,e=>{e?(c=r.length,p(e)):(c+=1)===r.length?l():h()});else{let t=!1;try{e.fn(...i)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l():h())}if(c===r.length)return};h()}}class d extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=()=>{this._runDoneInterceptors(),o(null)},p=e=>{this._runErrorInterceptors(e),o(e)},c=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return l();let h=0,u=()=>{let e=r[h];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{h+=1,void 0!==e?c(e):h===r.length?l():u()},e=>{h=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(h=r.length,p(e)):(h+=1,void 0!==t?c(t):h===r.length?l():u())});else{let t,s=!1;try{t=e.fn(...i)}catch(e){s=!0,h=r.length,p(e)}s||(h+=1,void 0!==t?c(t):h===r.length?l():u())}if(h===r.length)return};u()}}class y extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],i=this._prepareArgs(n);s===a&&this._runCallInterceptors(...i);let l=e=>{this._runResultInterceptors(e),o(null,e)},p=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return l(i[0]);let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...i);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e&&(i[0]=e),c===r.length?l(i[0]):h()},e=>{c=r.length,p(e)})}else if("async"===e.type)e.fn(...i,(e,t)=>{e?(c=r.length,p(e)):(c+=1,void 0!==t&&(i[0]=t),c===r.length?l(i[0]):h())});else{let t=!1;try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){t=!0,c=r.length,p(e)}t||((c+=1)===r.length?l(i[0]):h())}if(c===r.length)return};h()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let k=(e,t)=>t;class S{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:k},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new _(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class _{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class A{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new A(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var H in s.d(r,{AsyncParallelHook:()=>f,AsyncSeriesBailHook:()=>d,AsyncSeriesHook:()=>m,AsyncSeriesWaterfallHook:()=>y,HookBase:()=>o,HookMap:()=>S,MultiHook:()=>A,QueriedHook:()=>c,QueriedHookMap:()=>_,SyncBailHook:()=>u,SyncHook:()=>h,SyncWaterfallHook:()=>g},{maxStage:i,minStage:a,safeStage:e=>e<-0x80000000?-0x80000000:e>p?p:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(H)&&(t[H]=r[H]);Object.defineProperty(t,"__esModule",{value:!0})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.8/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
|
package/dist/server/helper.d.ts
CHANGED
|
@@ -31,11 +31,13 @@ export declare const getRoutes: (context: InternalContext) => Routes;
|
|
|
31
31
|
/*
|
|
32
32
|
* format route by entry and adjust the index route to be the first
|
|
33
33
|
*/ export declare const formatRoutes: (entry: RsbuildEntry, base: string, distPathPrefix: string | undefined, outputStructure: OutputStructure | undefined) => Routes;
|
|
34
|
+
type AddressUrl = {
|
|
35
|
+
label: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
url: string;
|
|
38
|
+
};
|
|
34
39
|
export declare function printServerURLs({ urls: originalUrls, port, routes, protocol, printUrls, fallbackPathname, showAllRoutes, cliShortcutsEnabled, originalConfig, logger }: {
|
|
35
|
-
urls:
|
|
36
|
-
url: string;
|
|
37
|
-
label: string;
|
|
38
|
-
}[];
|
|
40
|
+
urls: AddressUrl[];
|
|
39
41
|
port: number;
|
|
40
42
|
routes: Routes;
|
|
41
43
|
protocol: string;
|
|
@@ -64,10 +66,6 @@ export declare const resolvePort: (config: NormalizedConfig) => Promise<{
|
|
|
64
66
|
}>;
|
|
65
67
|
export declare const isWildcardHost: (host: string) => boolean;
|
|
66
68
|
export declare const getHostInUrl: (host: string) => Promise<string>;
|
|
67
|
-
type AddressUrl = {
|
|
68
|
-
label: string;
|
|
69
|
-
url: string;
|
|
70
|
-
};
|
|
71
69
|
export declare const getAddressUrls: ({ protocol, port, host }: {
|
|
72
70
|
protocol: string;
|
|
73
71
|
port: number;
|