@@ -30,6 +30,32 @@ const viewer = require("./viewer");
3030/** @typedef {string | (() => string) } ReportTitle */
3131/** @typedef {(options: { listenHost: string, listenPort: number, boundAddress: string | AddressInfo | null }) => string } AnalyzerUrl */
3232
33+ /** @type {StatsOptions } */
34+ const analyzerStatsOptions = {
35+ all : false ,
36+ assets : true ,
37+ cachedAssets : true ,
38+ cachedModules : true ,
39+ cached : true ,
40+ children : true ,
41+ chunks : true ,
42+ chunkModules : true ,
43+ chunkModulesSpace : Number . POSITIVE_INFINITY ,
44+ depth : true ,
45+ entrypoints : true ,
46+ errors : false ,
47+ errorsCount : false ,
48+ ids : true ,
49+ modules : true ,
50+ modulesSpace : Number . POSITIVE_INFINITY ,
51+ nestedModules : true ,
52+ nestedModulesSpace : Number . POSITIVE_INFINITY ,
53+ runtimeModules : false ,
54+ source : false ,
55+ warnings : false ,
56+ warningsCount : false ,
57+ } ;
58+
3359/**
3460 * @typedef {object } Options
3561 * @property {Mode= } analyzerMode analyzer mode
@@ -111,11 +137,17 @@ class BundleAnalyzerPlugin {
111137 }
112138
113139 if ( this . opts . analyzerMode === "server" ) {
114- actions . push ( ( ) => this . startAnalyzerServer ( stats . toJson ( ) ) ) ;
140+ actions . push ( ( ) =>
141+ this . startAnalyzerServer ( stats . toJson ( analyzerStatsOptions ) ) ,
142+ ) ;
115143 } else if ( this . opts . analyzerMode === "static" ) {
116- actions . push ( ( ) => this . generateStaticReport ( stats . toJson ( ) ) ) ;
144+ actions . push ( ( ) =>
145+ this . generateStaticReport ( stats . toJson ( analyzerStatsOptions ) ) ,
146+ ) ;
117147 } else if ( this . opts . analyzerMode === "json" ) {
118- actions . push ( ( ) => this . generateJSONReport ( stats . toJson ( ) ) ) ;
148+ actions . push ( ( ) =>
149+ this . generateJSONReport ( stats . toJson ( analyzerStatsOptions ) ) ,
150+ ) ;
119151 }
120152
121153 if ( actions . length ) {
0 commit comments