Webpack bundle analyzer plugin doesn't start

default discord avatar
Rick | Byont Labs
2 months ago

For unknown reasons the browsers sometimes loads a payload bundle of 38mb.

I want to analyze this with webpack-bundle-analyzer but nothing happens if I add this as a plugin. Its like it doesnt run..?

Though I can see in the debugger that it is instantiated.


const mockModulePath = path.resolve(__dirname, 'mocks/serverModule.js');

// some config and then
webpack: (config) => ({
      plugins: [...config.plugins, plugin],
      resolve: {
        alias: {
          BundleAnalyzerPlugin: mockModulePath,
          [path.resolve(__dirname, 'bundleAnalyzer')]: mockModulePath


import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
const plugin = new BundleAnalyzerPlugin({});

export default plugin;

Figured it out, ...config was overwriting my plugin 🙂

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.