@@ -107,6 +107,7 @@ function getChartData(analyzerOpts, bundleStats, bundleDir) {
107107 * @property {string } host host
108108 * @property {boolean } openBrowser true when need to open browser, otherwise false
109109 * @property {string | null } bundleDir bundle dir
110+ * @property {import("webpack").OutputFileSystem | null= } outputFs filesystem for reading bundle files
110111 * @property {Logger } logger logger
111112 * @property {Sizes } defaultSizes default sizes
112113 * @property {CompressionAlgorithm } compressionAlgorithm compression algorithm
@@ -128,6 +129,7 @@ async function startServer(bundleStats, opts) {
128129 host = "127.0.0.1" ,
129130 openBrowser = true ,
130131 bundleDir = null ,
132+ outputFs,
131133 logger = new Logger ( ) ,
132134 defaultSizes = "parsed" ,
133135 compressionAlgorithm,
@@ -136,7 +138,7 @@ async function startServer(bundleStats, opts) {
136138 analyzerUrl,
137139 } = opts || { } ;
138140
139- const analyzerOpts = { logger, excludeAssets, compressionAlgorithm } ;
141+ const analyzerOpts = { logger, excludeAssets, compressionAlgorithm, outputFs } ;
140142
141143 let chartData = getChartData ( analyzerOpts , bundleStats , bundleDir ) ;
142144
@@ -240,6 +242,7 @@ async function startServer(bundleStats, opts) {
240242 * @property {string } reportFilename report filename
241243 * @property {ReportTitle } reportTitle report title
242244 * @property {string | null } bundleDir bundle dir
245+ * @property {import("webpack").OutputFileSystem | null= } outputFs filesystem for reading bundle files
243246 * @property {Logger } logger logger
244247 * @property {Sizes } defaultSizes default sizes
245248 * @property {CompressionAlgorithm } compressionAlgorithm compression algorithm
@@ -257,14 +260,15 @@ async function generateReport(bundleStats, opts) {
257260 reportFilename,
258261 reportTitle,
259262 bundleDir = null ,
263+ outputFs,
260264 logger = new Logger ( ) ,
261265 defaultSizes = "parsed" ,
262266 compressionAlgorithm,
263267 excludeAssets = null ,
264268 } = opts || { } ;
265269
266270 const chartData = getChartData (
267- { logger, excludeAssets, compressionAlgorithm } ,
271+ { logger, excludeAssets, compressionAlgorithm, outputFs } ,
268272 bundleStats ,
269273 bundleDir ,
270274 ) ;
@@ -302,6 +306,7 @@ async function generateReport(bundleStats, opts) {
302306 * @typedef {object } GenerateJSONReportOptions
303307 * @property {string } reportFilename report filename
304308 * @property {string | null } bundleDir bundle dir
309+ * @property {import("webpack").OutputFileSystem | null= } outputFs filesystem for reading bundle files
305310 * @property {Logger } logger logger
306311 * @property {ExcludeAssets } excludeAssets exclude assets
307312 * @property {CompressionAlgorithm } compressionAlgorithm compression algorithm
@@ -316,13 +321,14 @@ async function generateJSONReport(bundleStats, opts) {
316321 const {
317322 reportFilename,
318323 bundleDir = null ,
324+ outputFs,
319325 logger = new Logger ( ) ,
320326 excludeAssets = null ,
321327 compressionAlgorithm,
322328 } = opts || { } ;
323329
324330 const chartData = getChartData (
325- { logger, excludeAssets, compressionAlgorithm } ,
331+ { logger, excludeAssets, compressionAlgorithm, outputFs } ,
326332 bundleStats ,
327333 bundleDir ,
328334 ) ;
0 commit comments