Closed AbstractAlao closed 1 year ago
Hi, this looks like it's a webpack configuration issue and not related to this plugin.
Yes, you were right. I updated it to the following and it started working
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify'),
url: require.resolve('url'),
},
},
plugins: [
new ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
new BundleAnalyzerPlugin(),
],
};
Issue description
I am getting the following error trying to run the webpack analyzer
Technical info
My webpack.config.js
my package.json
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
) webpack --profile --json > stats.json; webpack-bundle-analyzer ./stats.json If plugin, what options were provided? (e.g.new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)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. stats.json is empty