Closed yursha closed 2 years ago
Can you test which earlier version of webpack-bundle-analyzer
does work for you?
Same issue here. Downgrading to 3.7 and 3.6 didn't work either. I'm running the build with webpack-dev-server.
After some debugging, I don't know it this is a regression issue but what I saw is this:
fs.writeFileSync(reportFilepath, reportHtml);
I think this is not supposed to work with webpack-dev-server, right? Is webpack-bundle-analyzer only emitting files with the fs module? Isn't it a webpack plugin api for emitting files to the output directory? (for loaders, I known at least there is this.emitFile) I'm using webpack-bundle-analyzer as a plugin like this:
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpackConfig = {
//...
plugins: [
//...
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
}),
]
}
So the question is:
- Can this plugin work with webpack-dev-server (with ram files) or only with webpack cli?
No, it can't work with WBA (virtual file system).
@yursha does this issue still valid? I so, could you please create a reproduction repo.
Closing as there hasn't been a reproduction.
Issue description
analyzerMode: 'static'
doesn't seem to be working anymore. No report file is generated and the web server is started.Technical info
Debug info
How do you use this module? As CLI utility or as plugin?
Plugin
If CLI, what command was used? (e.g.
webpack-bundle-analyzer -O path/to/stats.json
)If plugin, what options were provided? (e.g.
new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)new BundleAnalyzerPlugin({ analyzerMode: 'static'})
What other Webpack plugins were used?
It would be nice to also attach webpack stats file. It can be generated using these options:
stats.json
will be created in Webpack bundle output directory.