fix syntax, add unknown properties, fix incorrect types

This commit is contained in:
Tobias Koppers 2021-02-05 13:19:32 +01:00
parent e04219d048
commit 1c8d138e63
6 changed files with 292 additions and 228 deletions

View File

@ -9,7 +9,8 @@ const identifierUtils = require("./util/identifier");
/** @typedef {import("../declarations/WebpackOptions").StatsOptions} StatsOptions */
/** @typedef {import("./Stats")} Stats */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} ToJsonOutput */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").KnownStatsCompilation} KnownStatsCompilation */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */
const indent = (str, prefix) => {
const rem = str.replace(/\n([^\n])/g, "\n" + prefix + "$1");
@ -74,11 +75,11 @@ class MultiStats {
/**
* @param {any} options stats options
* @returns {ToJsonOutput} json output
* @returns {StatsCompilation} json output
*/
toJson(options) {
options = this._createChildOptions(options, { forToString: false });
/** @type ToJsonOutput */
/** @type {KnownStatsCompilation} */
const obj = {};
obj.children = this.stats.map((stat, idx) => {
const obj = stat.toJson(options.children[idx]);

View File

@ -7,7 +7,7 @@
/** @typedef {import("../declarations/WebpackOptions").StatsOptions} StatsOptions */
/** @typedef {import("./Compilation")} Compilation */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} ToJsonOutput */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */
class Stats {
/**
@ -51,7 +51,7 @@ class Stats {
/**
* @param {(string|StatsOptions)=} options stats options
* @returns {ToJsonOutput} json output
* @returns {StatsCompilation} json output
*/
toJson(options) {
options = this.compilation.createStatsOptions(options, {

View File

@ -25,6 +25,7 @@ const memoize = require("./util/memoize");
/** @typedef {import("./Compilation").Asset} Asset */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
/** @typedef {import("./Parser").ParserState} ParserState */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */
/**
* @template {Function} T

View File

@ -29,6 +29,7 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
/** @typedef {import("../ChunkGroup").OriginRecord} OriginRecord */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Compilation").Asset} Asset */
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
/** @typedef {import("../Compilation").NormalizedStatsOptions} NormalizedStatsOptions */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Dependency")} Dependency */
@ -44,8 +45,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
/** @typedef {import("./StatsFactory")} StatsFactory */
/** @typedef {import("./StatsFactory").StatsFactoryContext} StatsFactoryContext */
/** @typedef {KnownStatsCompilation & Record<string, any>} StatsCompilation */
/**
* @typedef {Object} StatsCompilation
* @typedef {Object} KnownStatsCompilation
* @property {any=} env
* @property {string=} name
* @property {string=} hash
@ -68,30 +70,52 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {StatsError[]=} warnings
* @property {number=} warningsCount
* @property {StatsCompilation[]=} children
* @property {any=} logging
* @property {Record<string, StatsLogging>=} logging
*/
/** @typedef {KnownStatsLogging & Record<string, any>} StatsLogging */
/**
* @typedef {Partial<Asset> & {
* type: string,
* size?: number,
* related?: StatsAsset[] | {}, // TODO fix empty resolving as {}
* chunkNames?: (string|number)[],
* chunkIdHints?: (string|number)[],
* chunks?: (string|number)[],
* auxiliaryChunkNames?: (string|number)[],
* auxiliaryChunks?: (string|number)[],
* auxiliaryChunkIdHints?: (string|number)[],
* emitted?: boolean,
* comparedForEmit?: boolean,
* cached?: boolean,
* filteredRelated?: number,
* isOverSizeLimit?: boolean
* }} StatsAsset
* @typedef {Object} KnownStatsLogging
* @property {StatsLoggingEntry[]} entries
* @property {number} filteredEntries
* @property {boolean} debug
*/
/** @typedef {KnownStatsLoggingEntry & Record<string, any>} StatsLoggingEntry */
/**
* @typedef {Object} StatsChunkGroup
* @typedef {Object} KnownStatsLoggingEntry
* @property {string} type
* @property {string} message
* @property {string[]=} trace
* @property {StatsLoggingEntry[]=} children
* @property {any[]=} args
* @property {number=} time
*/
/** @typedef {KnownStatsAsset & Record<string, any>} StatsAsset */
/**
* @typedef {Object} KnownStatsAsset
* @property {string} type
* @property {string} name
* @property {AssetInfo} info
* @property {number} size
* @property {boolean} emitted
* @property {boolean} comparedForEmit
* @property {boolean} cached
* @property {StatsAsset[]=} related
* @property {(string|number)[]=} chunkNames
* @property {(string|number)[]=} chunkIdHints
* @property {(string|number)[]=} chunks
* @property {(string|number)[]=} auxiliaryChunkNames
* @property {(string|number)[]=} auxiliaryChunks
* @property {(string|number)[]=} auxiliaryChunkIdHints
* @property {number=} filteredRelated
* @property {boolean=} isOverSizeLimit
*/
/** @typedef {KnownStatsChunkGroup & Record<string, any>} StatsChunkGroup */
/**
* @typedef {Object} KnownStatsChunkGroup
* @property {string=} name
* @property {(string|number)[]=} chunks
* @property {({ name: string, size?: number })[]=} assets
@ -105,8 +129,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {boolean=} isOverSizeLimit
*/
/** @typedef {KnownStatsModule & Record<string, any>} StatsModule */
/**
* @typedef {Object} StatsModule
* @typedef {Object} KnownStatsModule
* @property {string=} type
* @property {string=} moduleType
* @property {string=} layer
@ -147,8 +172,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {ReturnType<Source["source"]>=} source
*/
/** @typedef {KnownStatsProfile & Record<string, any>} StatsProfile */
/**
* @typedef {Object} StatsProfile
* @typedef {Object} KnownStatsProfile
* @property {number} total
* @property {number} resolving
* @property {number} restoring
@ -161,16 +187,18 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {number} dependencies
*/
/** @typedef {KnownStatsModuleIssuer & Record<string, any>} StatsModuleIssuer */
/**
* @typedef {Object} StatsModuleIssuer
* @typedef {Object} KnownStatsModuleIssuer
* @property {string=} identifier
* @property {string=} name
* @property {(string|number)=} id
* @property {StatsProfile=} profile
*/
/** @typedef {KnownStatsModuleReason & Record<string, any>} StatsModuleReason */
/**
* @typedef {Object} StatsModuleReason
* @typedef {Object} KnownStatsModuleReason
* @property {string=} moduleIdentifier
* @property {string=} module
* @property {string=} moduleName
@ -185,8 +213,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {(string|number)=} resolvedModuleId
*/
/** @typedef {KnownStatsChunk & Record<string, any>} StatsChunk */
/**
* @typedef {Object} StatsChunk
* @typedef {Object} KnownStatsChunk
* @property {boolean} rendered
* @property {boolean} initial
* @property {boolean} entry
@ -210,8 +239,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {StatsChunkOrigin[]=} origins
*/
/** @typedef {KnownStatsChunkOrigin & Record<string, any>} StatsChunkOrigin */
/**
* @typedef {Object} StatsChunkOrigin
* @typedef {Object} KnownStatsChunkOrigin
* @property {string=} module
* @property {string=} moduleIdentifier
* @property {string=} moduleName
@ -220,8 +250,9 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {(string|number)=} moduleId
*/
/** @typedef {KnownStatsModuleTraceItem & Record<string, any>} StatsModuleTraceItem */
/**
* @typedef {Object} StatsModuleTraceItem
* @typedef {Object} KnownStatsModuleTraceItem
* @property {string=} originIdentifier
* @property {string=} originName
* @property {string=} moduleIdentifier
@ -231,13 +262,15 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {(string|number)=} moduleId
*/
/** @typedef {KnownStatsModuleTraceDependency & Record<string, any>} StatsModuleTraceDependency */
/**
* @typedef {Object} StatsModuleTraceDependency
* @typedef {Object} KnownStatsModuleTraceDependency
* @property {string=} loc
*/
/** @typedef {KnownStatsError & Record<string, any>} StatsError */
/**
* @typedef {Object} StatsError
* @typedef {Object} KnownStatsError
* @property {string} message
* @property {string=} chunkName
* @property {boolean=} chunkEntry
@ -253,6 +286,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
* @property {any=} stack
*/
/** @typedef {Asset & { type: string, related: PreprocessedAsset[] }} PreprocessedAsset */
/**
* @template T
* @template O
@ -262,8 +297,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
/**
* @typedef {Object} SimpleExtractors
* @property {ExtractorsByOption<Compilation, StatsCompilation>} compilation
* @property {ExtractorsByOption<StatsAsset, StatsAsset>} asset
* @property {ExtractorsByOption<StatsAsset, StatsAsset>} asset$visible
* @property {ExtractorsByOption<PreprocessedAsset, StatsAsset>} asset
* @property {ExtractorsByOption<PreprocessedAsset, StatsAsset>} asset$visible
* @property {ExtractorsByOption<{ name: string, chunkGroup: ChunkGroup }, StatsChunkGroup>} chunkGroup
* @property {ExtractorsByOption<Module, StatsModule>} module
* @property {ExtractorsByOption<Module, StatsModule>} module$visible
@ -510,12 +545,12 @@ const SIMPLE_EXTRACTORS = {
array.push(chunk);
}
}
/** @type {Map<string, StatsAsset>} */
/** @type {Map<string, PreprocessedAsset>} */
const assetMap = new Map();
/** @type {Set<StatsAsset>} */
/** @type {Set<PreprocessedAsset>} */
const assets = new Set();
for (const asset of compilation.getAssets()) {
/** @type {StatsAsset} */
/** @type {PreprocessedAsset} */
const item = {
...asset,
type: "asset",
@ -538,7 +573,7 @@ const SIMPLE_EXTRACTORS = {
assets.delete(depItem);
depItem.type = type;
item.related = item.related || [];
/** @type StatsAsset[] */ (item.related).push(depItem);
item.related.push(depItem);
}
}
}
@ -738,7 +773,9 @@ const SIMPLE_EXTRACTORS = {
let depthInCollapsedGroup = 0;
for (const [origin, logEntries] of compilation.logging) {
const debugMode = loggingDebug.some(fn => fn(origin));
/** @type {KnownStatsLoggingEntry[]} */
const groupStack = [];
/** @type {KnownStatsLoggingEntry[]} */
const rootList = [];
let currentList = rootList;
let processedLogEntries = 0;
@ -772,6 +809,7 @@ const SIMPLE_EXTRACTORS = {
} else if (entry.args && entry.args.length > 0) {
message = util.format(entry.args[0], ...entry.args.slice(1));
}
/** @type {KnownStatsLoggingEntry} */
const newEntry = {
...entry,
type,
@ -867,9 +905,7 @@ const SIMPLE_EXTRACTORS = {
c => Array.from(c.idNameHints),
compareIds
);
object.filteredRelated = asset.related
? /** @type StatsAsset[] */ (asset.related).length
: undefined;
object.filteredRelated = asset.related ? asset.related.length : undefined;
},
relatedAssets: (object, asset, context, options, factory) => {
const { type } = context;
@ -879,8 +915,7 @@ const SIMPLE_EXTRACTORS = {
context
);
object.filteredRelated = asset.related
? /** @type StatsAsset[] */ (asset.related).length -
/** @type StatsAsset[] */ (object.related).length
? asset.related.length - object.related.length
: undefined;
},
ids: (
@ -933,7 +968,7 @@ const SIMPLE_EXTRACTORS = {
).map(toAsset);
const assetsSize = assets.reduce(sizeReducer, 0);
const auxiliaryAssetsSize = auxiliaryAssets.reduce(sizeReducer, 0);
/** @type StatsChunkGroup */
/** @type {KnownStatsChunkGroup} */
const statsChunkGroup = {
name,
chunks: ids ? chunkGroup.chunks.map(c => c.id) : undefined,
@ -962,7 +997,7 @@ const SIMPLE_EXTRACTORS = {
compareIds
).map(toAsset);
/** @type StatsChunkGroup */
/** @type {KnownStatsChunkGroup} */
const childStatsChunkGroup = {
name: group.name,
chunks: ids ? group.chunks.map(c => c.id) : undefined,
@ -1017,7 +1052,7 @@ const SIMPLE_EXTRACTORS = {
for (const sourceType of module.getSourceTypes()) {
sizes[sourceType] = module.size(sourceType);
}
/** @type StatsModule */
/** @type {KnownStatsModule} */
const statsModule = {
type: "module",
moduleType: module.type,
@ -1062,7 +1097,7 @@ const SIMPLE_EXTRACTORS = {
for (const sourceType of module.getSourceTypes()) {
sizes[sourceType] = module.size(sourceType);
}
/** @type StatsModule */
/** @type {KnownStatsModule} */
const statsModule = {
identifier: module.identifier(),
name: module.readableIdentifier(requestShortener),
@ -1182,7 +1217,7 @@ const SIMPLE_EXTRACTORS = {
},
profile: {
_: (object, profile) => {
/** @type StatsProfile */
/** @type {KnownStatsProfile} */
const statsProfile = {
total:
profile.factory +
@ -1210,7 +1245,7 @@ const SIMPLE_EXTRACTORS = {
const { compilation, type } = context;
const { moduleGraph } = compilation;
const profile = moduleGraph.getProfile(module);
/** @type StatsModuleIssuer */
/** @type {KnownStatsModuleIssuer} */
const statsModuleIssuer = {
identifier: module.identifier(),
name: module.readableIdentifier(requestShortener)
@ -1229,7 +1264,7 @@ const SIMPLE_EXTRACTORS = {
const dep = reason.dependency;
const moduleDep =
dep && dep instanceof ModuleDependency ? dep : undefined;
/** @type StatsModuleReason */
/** @type {KnownStatsModuleReason} */
const statsModuleReason = {
moduleIdentifier: reason.originModule
? reason.originModule.identifier()
@ -1272,7 +1307,7 @@ const SIMPLE_EXTRACTORS = {
_: (object, chunk, { makePathsRelative, compilation: { chunkGraph } }) => {
const childIdByOrder = chunk.getChildIdsByOrders(chunkGraph);
/** @type StatsChunk */
/** @type {KnownStatsChunk} */
const statsChunk = {
rendered: chunk.rendered,
initial: chunk.canBeInitial(),
@ -1367,7 +1402,7 @@ const SIMPLE_EXTRACTORS = {
},
chunkOrigin: {
_: (object, origin, context, { requestShortener }) => {
/** @type StatsChunkOrigin */
/** @type {KnownStatsChunkOrigin} */
const statsChunkOrigin = {
module: origin.module ? origin.module.identifier() : "",
moduleIdentifier: origin.module ? origin.module.identifier() : "",

View File

@ -321,8 +321,7 @@ const SIMPLE_PRINTERS = {
: null;
if (
providedExportsCount !== null &&
providedExportsCount ===
/** @type string[] */ (module.usedExports).length
providedExportsCount === usedExports.length
) {
return cyan(formatFlag("all exports used"));
} else {

374
types.d.ts vendored
View File

@ -4829,6 +4829,108 @@ declare interface KnownNormalizedStatsOptions {
loggingDebug: Function[];
loggingTrace: boolean;
}
declare interface KnownStatsAsset {
type: string;
name: string;
info: AssetInfo;
size: number;
emitted: boolean;
comparedForEmit: boolean;
cached: boolean;
related?: StatsAsset[];
chunkNames?: (string | number)[];
chunkIdHints?: (string | number)[];
chunks?: (string | number)[];
auxiliaryChunkNames?: (string | number)[];
auxiliaryChunks?: (string | number)[];
auxiliaryChunkIdHints?: (string | number)[];
filteredRelated?: number;
isOverSizeLimit?: boolean;
}
declare interface KnownStatsChunk {
rendered: boolean;
initial: boolean;
entry: boolean;
recorded: boolean;
reason?: string;
size: number;
sizes?: Record<string, number>;
names?: string[];
idHints?: string[];
runtime?: string[];
files?: string[];
auxiliaryFiles?: string[];
hash: string;
childrenByOrder?: Record<string, (string | number)[]>;
id?: string | number;
siblings?: (string | number)[];
parents?: (string | number)[];
children?: (string | number)[];
modules?: StatsModule[];
filteredModules?: number;
origins?: StatsChunkOrigin[];
}
declare interface KnownStatsChunkGroup {
name?: string;
chunks?: (string | number)[];
assets?: { name: string; size?: number }[];
filteredAssets?: number;
assetsSize?: number;
auxiliaryAssets?: { name: string; size?: number }[];
filteredAuxiliaryAssets?: number;
auxiliaryAssetsSize?: number;
children?: { [index: string]: StatsChunkGroup[] };
childAssets?: { [index: string]: string[] };
isOverSizeLimit?: boolean;
}
declare interface KnownStatsChunkOrigin {
module?: string;
moduleIdentifier?: string;
moduleName?: string;
loc?: string;
request?: string;
moduleId?: string | number;
}
declare interface KnownStatsCompilation {
env?: any;
name?: string;
hash?: string;
version?: string;
time?: number;
builtAt?: number;
needAdditionalPass?: boolean;
publicPath?: string;
outputPath?: string;
assetsByChunkName?: Record<string, string[]>;
assets?: StatsAsset[];
filteredAssets?: number;
chunks?: StatsChunk[];
modules?: StatsModule[];
filteredModules?: number;
entrypoints?: Record<string, StatsChunkGroup>;
namedChunkGroups?: Record<string, StatsChunkGroup>;
errors?: StatsError[];
errorsCount?: number;
warnings?: StatsError[];
warningsCount?: number;
children?: StatsCompilation[];
logging?: Record<string, StatsLogging>;
}
declare interface KnownStatsError {
message: string;
chunkName?: string;
chunkEntry?: boolean;
chunkInitial?: boolean;
file?: string;
moduleIdentifier?: string;
moduleName?: string;
loc?: string;
chunkId?: string | number;
moduleId?: string | number;
moduleTrace?: any;
details?: any;
stack?: any;
}
declare interface KnownStatsFactoryContext {
type: string;
makePathsRelative?: (arg0: string) => string;
@ -4840,6 +4942,79 @@ declare interface KnownStatsFactoryContext {
cachedGetErrors?: (arg0: Compilation) => WebpackError[];
cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
}
declare interface KnownStatsLogging {
entries: StatsLoggingEntry[];
filteredEntries: number;
debug: boolean;
}
declare interface KnownStatsLoggingEntry {
type: string;
message: string;
trace?: string[];
children?: StatsLoggingEntry[];
args?: any[];
time?: number;
}
declare interface KnownStatsModule {
type?: string;
moduleType?: string;
layer?: string;
identifier?: string;
name?: string;
nameForCondition?: string;
index?: number;
preOrderIndex?: number;
index2?: number;
postOrderIndex?: number;
size?: number;
sizes?: { [index: string]: number };
cacheable?: boolean;
built?: boolean;
codeGenerated?: boolean;
cached?: boolean;
optional?: boolean;
orphan?: boolean;
id?: string | number;
issuerId?: string | number;
chunks?: (string | number)[];
assets?: (string | number)[];
dependent?: boolean;
issuer?: string;
issuerName?: string;
issuerPath?: StatsModuleIssuer[];
failed?: boolean;
errors?: number;
warnings?: number;
profile?: StatsProfile;
reasons?: StatsModuleReason[];
usedExports?: boolean | string[];
providedExports?: string[];
optimizationBailout?: string[];
depth?: number;
modules?: StatsModule[];
filteredModules?: number;
source?: string | Buffer;
}
declare interface KnownStatsModuleIssuer {
identifier?: string;
name?: string;
id?: string | number;
profile?: StatsProfile;
}
declare interface KnownStatsModuleReason {
moduleIdentifier?: string;
module?: string;
moduleName?: string;
resolvedModuleIdentifier?: string;
resolvedModule?: string;
type?: string;
active: boolean;
explanation?: string;
userRequest?: string;
loc?: string;
moduleId?: string | number;
resolvedModuleId?: string | number;
}
declare interface KnownStatsPrinterContext {
type?: string;
compilation?: StatsCompilation;
@ -4866,6 +5041,18 @@ declare interface KnownStatsPrinterContext {
formatTime?: (time: number, boldQuantity?: boolean) => string;
chunkGroupKind?: string;
}
declare interface KnownStatsProfile {
total: number;
resolving: number;
restoring: number;
building: number;
integration: number;
storing: number;
additionalResolving: number;
additionalIntegration: number;
factory: number;
dependencies: number;
}
declare class LazySet<T> {
constructor(iterable?: Iterable<T>);
readonly size: number;
@ -9459,106 +9646,12 @@ declare class Stats {
toJson(options?: string | StatsOptions): StatsCompilation;
toString(options?: any): string;
}
type StatsAsset = Partial<Asset> & {
type: string;
size?: number;
related?: {} | StatsAsset[];
chunkNames?: (string | number)[];
chunkIdHints?: (string | number)[];
chunks?: (string | number)[];
auxiliaryChunkNames?: (string | number)[];
auxiliaryChunks?: (string | number)[];
auxiliaryChunkIdHints?: (string | number)[];
emitted?: boolean;
comparedForEmit?: boolean;
cached?: boolean;
filteredRelated?: number;
isOverSizeLimit?: boolean;
};
declare interface StatsChunk {
rendered: boolean;
initial: boolean;
entry: boolean;
recorded: boolean;
reason?: string;
size: number;
sizes?: Record<string, number>;
names?: string[];
idHints?: string[];
runtime?: string[];
files?: string[];
auxiliaryFiles?: string[];
hash: string;
childrenByOrder?: Record<string, (string | number)[]>;
id?: string | number;
siblings?: (string | number)[];
parents?: (string | number)[];
children?: (string | number)[];
modules?: StatsModule[];
filteredModules?: number;
origins?: StatsChunkOrigin[];
}
declare interface StatsChunkGroup {
name?: string;
chunks?: (string | number)[];
assets?: { name: string; size?: number }[];
filteredAssets?: number;
assetsSize?: number;
auxiliaryAssets?: { name: string; size?: number }[];
filteredAuxiliaryAssets?: number;
auxiliaryAssetsSize?: number;
children?: { [index: string]: StatsChunkGroup[] };
childAssets?: { [index: string]: string[] };
isOverSizeLimit?: boolean;
}
declare interface StatsChunkOrigin {
module?: string;
moduleIdentifier?: string;
moduleName?: string;
loc?: string;
request?: string;
moduleId?: string | number;
}
declare interface StatsCompilation {
env?: any;
name?: string;
hash?: string;
version?: string;
time?: number;
builtAt?: number;
needAdditionalPass?: boolean;
publicPath?: string;
outputPath?: string;
assetsByChunkName?: Record<string, string[]>;
assets?: StatsAsset[];
filteredAssets?: number;
chunks?: StatsChunk[];
modules?: StatsModule[];
filteredModules?: number;
entrypoints?: Record<string, StatsChunkGroup>;
namedChunkGroups?: Record<string, StatsChunkGroup>;
errors?: StatsError[];
errorsCount?: number;
warnings?: StatsError[];
warningsCount?: number;
children?: StatsCompilation[];
logging?: any;
}
declare interface StatsError {
message: string;
chunkName?: string;
chunkEntry?: boolean;
chunkInitial?: boolean;
file?: string;
moduleIdentifier?: string;
moduleName?: string;
loc?: string;
chunkId?: string | number;
moduleId?: string | number;
moduleTrace?: any;
details?: any;
stack?: any;
}
type StatsAsset = KnownStatsAsset & Record<string, any>;
type StatsChunk = KnownStatsChunk & Record<string, any>;
type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
type StatsCompilation = KnownStatsCompilation & Record<string, any>;
type StatsError = KnownStatsError & Record<string, any>;
declare abstract class StatsFactory {
hooks: Readonly<{
extract: HookMap<SyncBailHook<[Object, any, StatsFactoryContext], any>>;
@ -9598,66 +9691,11 @@ declare abstract class StatsFactory {
): any;
}
type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
declare interface StatsModule {
type?: string;
moduleType?: string;
layer?: string;
identifier?: string;
name?: string;
nameForCondition?: string;
index?: number;
preOrderIndex?: number;
index2?: number;
postOrderIndex?: number;
size?: number;
sizes?: { [index: string]: number };
cacheable?: boolean;
built?: boolean;
codeGenerated?: boolean;
cached?: boolean;
optional?: boolean;
orphan?: boolean;
id?: string | number;
issuerId?: string | number;
chunks?: (string | number)[];
assets?: (string | number)[];
dependent?: boolean;
issuer?: string;
issuerName?: string;
issuerPath?: StatsModuleIssuer[];
failed?: boolean;
errors?: number;
warnings?: number;
profile?: StatsProfile;
reasons?: StatsModuleReason[];
usedExports?: boolean | string[];
providedExports?: string[];
optimizationBailout?: string[];
depth?: number;
modules?: StatsModule[];
filteredModules?: number;
source?: string | Buffer;
}
declare interface StatsModuleIssuer {
identifier?: string;
name?: string;
id?: string | number;
profile?: StatsProfile;
}
declare interface StatsModuleReason {
moduleIdentifier?: string;
module?: string;
moduleName?: string;
resolvedModuleIdentifier?: string;
resolvedModule?: string;
type?: string;
active: boolean;
explanation?: string;
userRequest?: string;
loc?: string;
moduleId?: string | number;
resolvedModuleId?: string | number;
}
type StatsLogging = KnownStatsLogging & Record<string, any>;
type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
type StatsModule = KnownStatsModule & Record<string, any>;
type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
/**
* Stats options object.
@ -10088,18 +10126,7 @@ declare abstract class StatsPrinter {
print(type: string, object: Object, baseContext?: Object): string;
}
type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
declare interface StatsProfile {
total: number;
resolving: number;
restoring: number;
building: number;
integration: number;
storing: number;
additionalResolving: number;
additionalIntegration: number;
factory: number;
dependencies: number;
}
type StatsProfile = KnownStatsProfile & Record<string, any>;
type StatsValue =
| boolean
| "none"
@ -11174,7 +11201,8 @@ declare namespace exports {
WebpackPluginInstance,
Asset,
AssetInfo,
ParserState
ParserState,
StatsCompilation
};
}