Stats Field Reference

mf-stats.json é generated quando manifest é habilitado. It contains full build statistics, including exposes/shared/remotes assets, metaData (build info, remoteEntry, etc.), e asset analysis results.

Use este document para understand every field em mf-stats.json, que é helpful for debugging e analysis.

Top-level

FieldTipoObrigatórioDescription
idstringYesUnique build identifier
namestringYesFederation name
metaDataStatsMetaDataYesBuild e remote entry info
sharedStatsShared[]YesShared dependências (full details)
remotesStatsRemote[]YesRemotes (entry/versão plus uso)
exposesStatsExpose[]YesExpõe (assets e dependências)

metaData (Both Files)

metaData describes how this build is consumed at runtime and the build context. Both mf-stats.json and mf-manifest.json include it.

StatsMetaData

StatsMetaData has two mutually exclusive shapes:

  • Function form: getPublicPath: string
  • String form: publicPath: string (optional ssrPublicPath: string)

Shared fields:

FieldTypeRequiredDescription
namestringYesCurrent remote/host name
globalNamestringYesGlobal name for the remoteEntry
buildInfoStatsBuildInfoYesBuild information
remoteEntryResourceInfoYesRemote entry resource
ssrRemoteEntryResourceInfoNoSSR remote entry (if any)
typesMetaDataTypesNoTypes bundle info (if any)
typestringYesAPP, NPM
pluginVersionstringNoMF Plugin version

ResourceInfo

FieldTypeRequiredDescription
pathstringYesRelative path in build output
namestringYesFile name
typeRemoteEntryTypeYesRemote entry format (var/umd/system/...)

StatsBuildInfo

FieldTypeRequiredDescription
buildVersionstringYesBuild version
buildNamestringYesBuild name
targetstring[]NoBuild targets
pluginsstring[]NoTree-shaking plugins
excludePluginsstring[]NoTree-shaking exclude plugins

MetaDataTypes

FieldTypeRequiredDescription
pathstringYesOutput path
namestringYesFile name (required for legacy types, will be deprecated)
apistringYesAPI entry
zipstringYesZip path

assets (Both Files)

StatsAssets describes sync/async assets for a shared or exposed module. Both files use it.

StatsAssets

FieldTypeRequiredDescription
jsStatsAssetsInfoYesJavaScript assets
cssStatsAssetsInfoYesCSS assets

StatsAssetsInfo

FieldTypeRequiredDescription
syncstring[]YesInitial assets
asyncstring[]YesAsync assets

shared

StatsShared

FieldTipoObrigatórioDescription
idstringYesShared id
namestringYesPacote name
versionstringYesVersão usado em este build
singletonbooleanYesSingleton
requiredVersionstringYesrequiredVersion
hashstringYesContent hash
assetsStatsAssetsYesAssets
depsstring[]YesDependências
usedInstring[]YesUsado by containers/módulos
usedExportsstring[]YesUsado exporta
fallbackstringYesTreeshaking Fallback caminho/id
fallbackNamestringYesTreeshaking Fallback name
fallbackTypeRemoteEntryTypeYesTreeshaking Fallback tipo

remotes

StatsRemote records remote consumption info. It always includes either entry ou version.

StatsRemoteVal (shared fields)

FieldTipoObrigatórioDescription
moduleNamestringYesRemote módulo name
federationContainerNamestringYesRemote container name
consumingFederationContainerNamestringYesConsumer container name
aliasstringYesAlias
usedInstring[]YesUsado by containers/módulos

StatsRemote (mutually exclusive)

  • entry: string (exists, then no version)
  • version: string (exists, then no entry)

exposes

StatsExpose

FieldTipoObrigatórioDescription
idstringYesExponha id
namestringYesExponha name (e.g. ./Button)
pathstringNoSource caminho
filestringYesOutput arquivo
requiresstring[]YesDependências
assetsStatsAssetsYesAssets