object
string
stats
éé¡¹è®©ä½ æ´ç²¾ç¡®å°æ§å¶ bundle ä¿¡æ¯è¯¥æä¹æ¾ç¤ºã å¦æä½ ä¸å¸æä½¿ç¨ quiet
æ noInfo
è¿æ ·çä¸æ¾ç¤ºä¿¡æ¯ï¼èæ¯åä¸æ³å¾å°å
¨é¨çä¿¡æ¯ï¼åªæ¯æ³è¦è·åæé¨å bundle çä¿¡æ¯ï¼ä½¿ç¨ stats é项æ¯æ¯è¾å¥½çæè¡·æ¹å¼ã
module.exports = {
//...
stats: 'errors-only',
};
webpack æä¸äºç¹å®çé¢è®¾é项ç»ç»è®¡ä¿¡æ¯è¾åºï¼
é¢è®¾ | å¯éå¼ | æè¿° |
---|---|---|
'errors-only' | none | åªå¨åçé误æ¶è¾åº |
'errors-warnings' | none | åªå¨åçé误ææè¦åæ¶è¾åº |
'minimal' | none | åªå¨åçé误ææ°çç¼è¯å¼å§æ¶è¾åº |
'none' | false | 没æè¾åº |
'normal' | true | æ åè¾åº |
'verbose' | none | å ¨é¨è¾åº |
'detailed' | none | å
¨é¨è¾åºé¤äº chunkModules å chunkRootModules |
'summary' | none | è¾åº webpack çæ¬ï¼ä»¥åè¦åæ°åéè¯¯æ° |
ä½ å¯ä»¥å¨ç»è®¡è¾åºéæå®ä½ æ³çå°çä¿¡æ¯ã
å½ç»è®¡ä¿¡æ¯é 置没被å®ä¹ï¼å该å¼æ¯ä¸ä¸ªåéå¼ãå®çä¼å 级æ¯æ¬å°ç webpack é»è®¤å¼é«ã
module.exports = {
//...
stats: {
all: undefined,
},
};
boolean = true
åç¥ stats
æ¯å¦å±ç¤ºèµæºä¿¡æ¯ãå° stats.assets
设置æ false
ä¼ç¦ç¨.
module.exports = {
//...
stats: {
assets: false,
},
};
string = 'id'
åç¥ stats
åºäºç»å®çå段对èµæºè¿è¡æåºãææç æåºå段é½è¢«å
许ä½ä¸º stats.assetsSort
çå¼ãä½¿ç¨ !
ä½ä¸ºå¼çåç¼ä»¥å转åºäºç»å®å段çæåºç»æã
module.exports = {
//...
stats: {
assetsSort: '!size',
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å æ建æ¥æä¸æ¶é´ä¿¡æ¯ãå° stats.builtAt
设置æ false
æ¥éè.
module.exports = {
//...
stats: {
builtAt: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å 模åå
çèµæºä¿¡æ¯ãå° stats.moduleAssets
设置æ false
以éèã
module.exports = {
//...
stats: {
moduleAssets: false,
},
};
number = 15
åè¯ stats
åºè¯¥æ¾ç¤ºå¤å°ä¸ª asset 项ç®ï¼å°ä»¥ç»çæ¹å¼æå ï¼ä»¥éåºè¿ä¸ªç©ºé´ï¼ã
module.exports = {
//...
stats: {
assetsSpace: 15,
},
};
number = 15
åè¯ stats
åºè¯¥æ¾ç¤ºå¤å°ä¸ªæ¨¡å项ç®ï¼å°ä»¥ç»çæ¹å¼æå ï¼ä»¥éåºè¿ä¸ªç©ºé´ï¼ã
module.exports = {
//...
stats: {
modulesSpace: 15,
},
};
number = 10
åè¯ stats
æ¾ç¤ºå¤å°ä¸ª chunk 模å项ç®ï¼å°ä»¥ç»çæ¹å¼æå ï¼ä»¥éåºè¿ä¸ªç©ºé´ï¼ã
module.exports = {
//...
stats: {
chunkModulesSpace: 15,
},
};
boolean
åç¥ stats
æ¯å¦æ·»å åµå¥å¨å
¶ä»æ¨¡åä¸ç模åä¿¡æ¯ï¼æ¯å¦æ¨¡åèé¦ï¼ã
module.exports = {
//...
stats: {
nestedModules: true,
},
};
number = 10
åè¯ stats
åºè¯¥æ¾ç¤ºå¤å°ä¸ªåµå¥æ¨¡åç项ç®ï¼å°ä»¥ç»çæ¹å¼æå ï¼ä»¥éåºè¿ä¸ªç©ºé´ï¼ã
module.exports = {
//...
stats: {
nestedModulesSpace: 15,
},
};
æ§çç stats.cachedModules
.
boolean = true
åè¯ stats
æ¯å¦è¦ç¼åï¼éå
ç½®ï¼æ¨¡åçä¿¡æ¯ã
module.exports = {
//...
stats: {
cachedModules: false,
},
};
boolean = true
åè¯ stats
æ¯å¦è¦æ·»å è¿è¡æ¶æ¨¡åçä¿¡æ¯ã
module.exports = {
//...
stats: {
runtimeModules: false,
},
};
boolean
åè¯ stats
æ¯å¦è¦å±ç¤ºè¯¥ chunk ä¾èµçå
¶ä»æ¨¡åç chunk 模åã
module.exports = {
//...
stats: {
dependentModules: false,
},
};
boolean
åè¯ stats
æ¯å¦æç
§ asset ä¸ chunk çå
³ç³»è¿è¡åç»ã
module.exports = {
//...
stats: {
groupAssetsByChunk: false,
},
};
boolean
åè¯ stats
æ¯å¦æç
§ asset çç¶æè¿è¡åç»ï¼emittedï¼å¯¹æ¯ emit æç¼åï¼.
module.exports = {
//...
stats: {
groupAssetsByEmitStatus: false,
},
};
boolean
åè¯ stats
æ¯å¦æ ¹æ®å®ä»¬çæå±åèåéæèµæºã
module.exports = {
//...
stats: {
groupAssetsByExtension: false,
},
};
boolean
åè¯ stats
æ¯å¦æç
§ asset ä¿¡æ¯å¯¹ asset è¿è¡åç»ï¼immutableï¼developmentãhotModuleReplacement çï¼ã
module.exports = {
//...
stats: {
groupAssetsByInfo: false,
},
};
boolean
åè¯ stats
æ¯å¦æ ¹æ®å®ä»¬çè·¯å¾èåéæèµæºã
module.exports = {
//...
stats: {
groupAssetsByPath: false,
},
};
boolean
åè¯ stats
æ¯å¦æ模åçå±æ§è¿è¡åç»ï¼errorsï¼warningsï¼assetsï¼optionalï¼orphan æè
dependentï¼ã
module.exports = {
//...
stats: {
groupModulesByAttributes: false,
},
};
boolean
åè¯ stats
æ¯å¦æ模åçç¼åç¶æè¿è¡åç»ï¼å·²ç¼åæè
å·²æ建并ä¸å¯ç¼åï¼ã
module.exports = {
//...
stats: {
groupModulesByCacheStatus: true,
},
};
boolean
åè¯ stats
æ¯å¦æ模åçæå±åè¿è¡åç»ã
module.exports = {
//...
stats: {
groupModulesByExtension: true,
},
};
boolean
åè¯ stats
æ¯å¦æ模åç layer è¿è¡åç»ã
module.exports = {
//...
stats: {
groupModulesByLayer: true,
},
};
boolean
åè¯ stats
æ¯å¦æ模åçè·¯å¾è¿è¡åç»ã
module.exports = {
//...
stats: {
groupModulesByPath: true,
},
};
boolean
åè¯ stats
æ¯å¦æ模åçç±»åè¿è¡åç»ã
module.exports = {
//...
stats: {
groupModulesByType: true,
},
};
boolean
Group reasons
by their origin module to avoid large set of reasons.
module.exports = {
//...
stats: {
groupReasonsByOrigin: true,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äºç¼åèµæºçä¿¡æ¯ã å° stats.cachedAssets
设置æ false
ä¼åç¥ stats
ä»
å±ç¤ºè¢«çæçæ件 (并é被æ建ç模å)ã
module.exports = {
//...
stats: {
cachedAssets: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äºå模åçä¿¡æ¯ã
module.exports = {
//...
stats: {
children: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äº chunk çä¿¡æ¯ã å° stats.chunks
设置为 false
ä¼å¼åæ´å°çè¾åºã
module.exports = {
//...
stats: {
chunks: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äº namedChunkGroups
çä¿¡æ¯ã
module.exports = {
//...
stats: {
chunkGroups: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äºå·²æ建模ååå
³äº chunk çä¿¡æ¯ã
module.exports = {
//...
stats: {
chunkModules: false,
},
};
boolean = true
åç¥ stats
æ¯ä¸æ·»å å
³äº chunks çæ¥æºå chunk å并çä¿¡æ¯ã
module.exports = {
//...
stats: {
chunkOrigins: false,
},
};
string = 'id'
åç¥ stats
åºäºç»å®çåæ®µç» chunks æåºãææ æåºå段 é½è¢«å
许ç¨äºä½ä¸º stats.chunksSort
çå¼ãä½¿ç¨ !
ä½ä¸ºå¼éçåç¼ç¨ä»¥å°åºäºç»å®å段æåºçç»æå转ã
module.exports = {
//...
stats: {
chunksSort: 'name',
},
};
string
stats çåºæ¬ç®å½ï¼ç¨æ¥ç¼©ç请æ±ä¿¡æ¯ç ç»å¯¹è·¯å¾ã
const path = require('path');
module.exports = {
//...
stats: {
context: path.resolve(__dirname, 'src/components'),
},
};
é»è®¤æ
åµä¸ï¼context
çå¼æ¯ Node.js çå½åå·¥ä½ç®å½ã
boolean = false
object
åç¥ stats
æ¯å¦è¾åºä¸åçé¢è²ã
module.exports = {
//...
stats: {
colors: true,
},
};
å®ä¹å¯ç¨éè¿å½ä»¤è¡çåæ°å®ç°ï¼
npx webpack --stats-colors
To disable:
npx webpack --no-stats-colors
ä½ å¯ä»¥éè¿ä½¿ç¨ ANSI escape sequences æå®ä½ èªå·±çå½ä»¤è¡ç»ç«¯é¢è²ã
module.exports = {
//...
colors: {
green: '\u001b[32m',
},
};
boolean = false
åç¥ stats
æ¯å¦å±ç¤ºæ¯ä¸ªæ¨¡åä¸å
¥å£æ件çè·ç¦»ã
module.exports = {
//...
stats: {
depth: true,
},
};
boolean = true
string = 'auto'
åç¥ stats
æ¯å¦å±ç¤ºå
¥å£æ件ä¸å¯¹åºçæ件 bundlesã
module.exports = {
//...
stats: {
entrypoints: false,
},
};
å½ stats.entrypoints
被设置为 'auto'
æ¶ï¼webpack å°èªå¨å³å®æ¯å¦å¨ stats è¾åºä¸å±ç¤ºå
¥å£ä¿¡æ¯ã
boolean = false
åç¥ stats
æ¯å¦å±ç¤º --env
ä¿¡æ¯.
module.exports = {
//...
stats: {
env: true,
},
};
boolean = false
åç¥ stats
æ¯å¦éè å¤å¿(orphan)
模å. ä¸ä¸ªæ¨¡åå±äº å¤å¿(orphan)
å¦æå®ä¸è¢«å
å«å¨ä»»ä½ä¸ä¸ª chunk éãå¤å¿æ¨¡åé»è®¤å¨ stats
ä¸ä¼è¢«éèã
module.exports = {
//...
stats: {
orphanModules: true,
},
};
boolean = true
åç¥ stats
æ¯å¦å±ç¤ºé误ã
module.exports = {
//...
stats: {
errors: false,
},
};
boolean
string = "auto"
åç¥ stats
æ¯å¦æ·»å é误ç详æ
ãå¦æé»è®¤å¼ä¸º 'auto'
ï¼å½åªæ 2 个ææ´å°çé误æ¶ï¼å®å°æ¾ç¤ºé误详æ
ã
module.exports = {
//...
stats: {
errorDetails: false,
},
};
boolean = true
åç¥ stats
æ¯å¦å±ç¤ºéä½çæ 追踪信æ¯ã
module.exports = {
//...
stats: {
errorStack: false,
},
};
array = []: string | RegExp | function (assetName) => boolean
string
RegExp
function (assetName) => boolean
åç¥ stats
æé¤æå¹é
çèµæºä¿¡æ¯ãè¿ä¸ªå¯ä»¥éè¿è®¾ç½®ä¸ä¸ª å符串
, ä¸ä¸ª æ£å表达å¼
, ä¸ä¸ª å½æ°
åå¾èµæºçååä½ä¸ºå
¥åä¸è¿åä¸ä¸ª å¸å°å¼
ã stats.excludeAssets
å¯ä»¥æ¯ä¸ä¸ªå
æ¬ä¸é¢ä»»æä¸ç±»åå¼ç æ°ç»
ã
module.exports = {
//...
stats: {
excludeAssets: [
'filter',
/filter/,
(assetName) => assetName.contains('moduleA'),
],
},
};
array = []: string | RegExp | function (assetName) => boolean
string
RegExp
function (assetName) => boolean
boolean: false
åç¥ stats
æé¤æå¹é
çèµæºä¿¡æ¯ãè¿ä¸ªå¯ä»¥éè¿è®¾ç½®ä¸ä¸ª å符串
, ä¸ä¸ª æ£å表达å¼
, ä¸ä¸ª å½æ°
åå¾èµæºçååä½ä¸ºå
¥åä¸è¿åä¸ä¸ª å¸å°å¼
ã stats.excludeModules
å¯ä»¥æ¯ä¸ä¸ªå
æ¬ä¸é¢ä»»æä¸ç±»åå¼ç æ°ç»
ãstats.excludeModules
ä¼ä¸ stats.exclude
çé
ç½®å¼è¿è¡å并ã
module.exports = {
//...
stats: {
excludeModules: ['filter', /filter/, (moduleSource) => true],
},
};
å° stats.excludeModules
设置为 false
ä¼ç¦ç¨ä»¥ä¸çæé¤è¡ä¸ºã
module.exports = {
//...
stats: {
excludeModules: false,
},
};
详å stats.excludeModules
.
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äºç¼è¯åå¸å¼çä¿¡æ¯ã
module.exports = {
//...
stats: {
hash: false,
},
};
string = 'info': 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose'
boolean
åç¥ stats
æ¯å¦æ·»å æ¥å¿è¾åºã
'none'
, false
- ç¦ç¨æ¥å¿'error'
- ä»
æ¾ç¤ºé误'warn'
- ä»
æ¾ç¤ºé误ä¸åè¦'info'
- æ¾ç¤ºé误ï¼åè¦ä¸ä¿¡æ¯'log'
, true
- æ¾ç¤ºé误ï¼åè¦ä¸ä¿¡æ¯ï¼æ¥å¿ï¼ç»å«ï¼æ¸
çãæå ç»å«ä¼å¨æå ç¶æä¸è¢«æ¾ç¤º ã'verbose'
- è¾åºæææ¥å¿é¤äºè°è¯ä¸è¿½è¸ªã æå ç»å«ä¼å¨æ©å±ç¶æä¸è¢«æ¾ç¤º ãmodule.exports = {
//...
stats: {
logging: 'verbose',
},
};
array = []: string | RegExp | function (name) => boolean
string
RegExp
function (name) => boolean
åç¥ stats
å»å
æ¬ç¹å®çæ¥å¿å·¥å
·è°è¯ä¿¡æ¯æ¯å¦æ件æå è½½å¨çæ¥å¿å·¥å
·ãå½ stats.logging
被设置为 false
, stats.loggingDebug
é
ç½®ä¼è¢«å¿½ç¥ã
module.exports = {
//...
stats: {
loggingDebug: [
'MyPlugin',
/MyPlugin/,
/webpack/, // To get core logging
(name) => name.contains('MyPlugin'),
],
},
};
boolean = true
å¯ç¨é误ï¼åè¦ä¸è¿½è¸ªçæ¥å¿è¾åºä¸çå æ 追踪ãå° stats.loggingTrace
设置为 false
éè追踪ã
module.exports = {
//...
stats: {
loggingTrace: false,
},
};
boolean = true
åç¥ stats
æ¯å¦æ·»å å
³äºæ建模åçä¿¡æ¯ã
module.exports = {
//...
stats: {
modules: false,
},
};
string = 'id'
åç¥ stats
åºäºç»å®çå段对èµæºè¿è¡æåºãææç æåºå段é½è¢«å
许ä½ä¸º stats.modulesSort
çå¼ãä½¿ç¨ !
ä½ä¸ºå¼çåç¼ä»¥å转åºäºç»å®å段çæåºç»æã
module.exports = {
//...
stats: {
modulesSort: 'size',
},
};
boolean = true
åç¥ stats
å±ç¤ºä¾èµååè¦/é误çæ¥æºãstats.moduleTrace
ä» webpack 2.5.0 èµ·å¯ç¨ã
module.exports = {
//...
stats: {
moduleTrace: false,
},
};
boolean
åè¯ stats
å±ç¤ºæ¨¡åä¼å失æçåå ã
module.exports = {
//...
stats: {
optimizationBailout: false,
},
};
boolean = true
åç¥ stats
å±ç¤º outputPath
.
module.exports = {
//...
stats: {
outputPath: false,
},
};
boolean = true
åç¥ stats
å½æ件大å°è¶
è¿ performance.maxAssetSize
é
ç½®å¼æ¶ï¼å±ç¤ºæ§è½ææ§ã
module.exports = {
//...
stats: {
performance: false,
},
};
string
boolean: false
为å±ç¤ºçä¿¡æ¯ç±»å设置 é¢è®¾å¼ãè¿å¯¹æ©å±ç»è®¡ä¿¡æ¯è¡ä¸ºé常æç¨ã
module.exports = {
//...
stats: {
preset: 'minimal',
},
};
å° stats.preset
çå¼è®¾ç½®ä¸ºfalse
åç¥ webpack ä½¿ç¨ 'none'
ç»è®¡ä¿¡æ¯é¢è®¾å¼ã
boolean = false
åç¥ stats
å»å±ç¤ºæ¨¡åç导åºã
module.exports = {
//...
stats: {
providedExports: true,
},
};
boolean = true
æ·»å å±ç¤º errors 个æ°ã
module.exports = {
//...
stats: {
errorsCount: false,
},
};
boolean = true
æ·»å å±ç¤º warnings 个æ°ã
module.exports = {
//...
stats: {
warningsCount: false,
},
};
boolean = true
åç¥ stats
å±ç¤º publicPath
ã
module.exports = {
//...
stats: {
publicPath: false,
},
};
boolean = true
åç¥ stats
æ·»å å
³äºæ¨¡å被å¼ç¨çåå ä¿¡æ¯ã
module.exports = {
//...
stats: {
reasons: false,
},
};
number
Space to display reasons
(groups will be collapsed to fit this space).
module.exports = {
//...
stats: {
reasonsSpace: 1000,
},
};
boolean = false
åè¯ stats
æ¯å¦éæ·»å ä¸å
¶ä» assets ç¸å
³çä¿¡æ¯ï¼ä¾å¦ assets ç SourceMapsï¼ã
module.exports = {
//...
stats: {
relatedAssets: true,
},
};
boolean = false
åç¥ stats
å»æ·»å 模åçæºç ã
module.exports = {
//...
stats: {
source: true,
},
};
boolean = true
åç¥ stats
æ·»å æ¶é´ä¿¡æ¯ã
module.exports = {
//...
stats: {
timings: false,
},
};
boolean = false
éç¥ stats
ç» module å chunk æ·»å idã
module.exports = {
//...
stats: {
ids: true,
},
};
boolean = false
åç¥ stats
æ¯å¦å±ç¤ºæ¨¡åç¨äºåªäºå¯¼åºã
module.exports = {
//...
stats: {
usedExports: true,
},
};
boolean = true
åç¥ stats
æ·»å å
³äº webpack çæ¬çä¿¡æ¯ã
module.exports = {
//...
stats: {
version: false,
},
};
boolean = true
å¨ chunk ç»ä¸å±ç¤ºè¾ å© assetã
module.exports = {
//...
stats: {
chunkGroupAuxiliary: false,
},
};
boolean = true
æ¾ç¤º chunk ç»çå chunkãï¼ä¾å¦ï¼é¢ç½®ï¼prefetchedï¼ï¼é¢å è½½ï¼preloadedï¼ç chunk å asset)ã
module.exports = {
//...
stats: {
chunkGroupChildren: false,
},
};
number
chunk ç»ä¸ç asset æ°ä¸éã
module.exports = {
//...
stats: {
chunkGroupMaxAssets: 5,
},
};
boolean = true
åç¥ stats
æ·»å åè¦ã
module.exports = {
//...
stats: {
warnings: false,
},
};
array = []: string | RegExp | function (warning) => boolean
string
RegExp
function (warning) => boolean
åç¥ stats
æé¤æå¹é
çåè¦ä¿¡æ¯ãè¿ä¸ªå¯ä»¥éè¿è®¾ç½®ä¸ä¸ª å符串
, ä¸ä¸ª æ£å表达å¼
, ä¸ä¸ª å½æ°
åå¾èµæºçååä½ä¸ºå
¥åä¸è¿åä¸ä¸ª å¸å°å¼
ã stats.warningsFilter
å¯ä»¥æ¯ä¸ä¸ªå
æ¬ä¸é¢ä»»æä¸ç±»åå¼ç æ°ç»
ã
module.exports = {
//...
stats: {
warningsFilter: ['filter', /filter/, (warning) => true],
},
};
boolean = false
åç¥ stats
å±ç¤º chunk çç¶ chunkï¼å©å chunk åå
å¼ chunkã
å¯¹äº assetsSort
, chunksSort
å modulesSort
å®ä»¬æå 个å¯ç¨çå段ç¨äºæåºï¼
'id'
æ¯å
ç´ ï¼æèµæºï¼chunk æ模åï¼ä¸åï¼ç id;'name'
- ä¸ä¸ªå
ç´ çååï¼å¨å¯¼å¼çæ¶å被åé
ï¼'size'
- ä¸ä¸ªå
ç´ ç大å°ï¼åä½åèï¼bytesï¼;'chunks'
- å
ç´ æ¥æºäºåªäº chunks (ä¾å¦ï¼ä¸ä¸ª chunk æå¤ä¸ªå chunksï¼ - å chunks ä¼è¢«åºäºä¸» chunk ç»åå°ä¸èµ·);'errors'
- å
ç´ ç»é误çæ°é;'warnings'
- å
ç´ ä¸åè¦çæ°é;'failed'
- å
ç´ æ¯è¢«ç¼è¯å¤±è´¥;'cacheable'
- å
ç´ æ¯å¦è¢«ç¼å;'built'
- èµæºæ¯å¦è¢«æ建;'prefetched'
- èµæºæ¯å¦è¢«é¢æå;'optional'
- èµæºæ¯å¦å¯é;'identifier'
- å
ç´ çæ è¯ç¬¦;'index'
- å
ç´ å å·¥æé;'index2'
'profile'
'issuer'
- åèµ·è
(issuer)çæ è¯ç¬¦;'issuerId'
- åèµ·è
(issuer)ç id;'issuerName'
- åèµ·è
(issuer)çåå;'issuerPath'
- ä¸ä¸ªå®æ´çåèµ·è
(issuer)对象ãåºäºè¿ä¸ªå段æåºæ²¡æç°å®çéè¦;å¦æä½ æ³ä½¿ç¨å
¶ä¸ä¸ä¸ªé¢å®ä¹çè¡ä¸ºï¼ä¾å¦ 'minimal'
ï¼ä½ä»æ³éè½½ä¸ä¸ªææ´å¤çè§åï¼è¯·æå®æ³è¦è®¾ç½®ç stats.preset
åæ¶å¨åé¢æ·»å èªå®ä¹æé¢å¤çè§åã
webpack.config.js
module.exports = {
//..
stats: {
preset: 'minimal',
moduleTrace: true,
errorDetails: true,
},
};