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.
payload.config.ts
const mockModulePath = path.resolve(__dirname, 'mocks/serverModule.js');
// some config and then
webpack: (config) => ({
plugins: [...config.plugins, plugin],
...config,
resolve: {
...config.resolve,
alias: {
BundleAnalyzerPlugin: mockModulePath,
[path.resolve(__dirname, 'bundleAnalyzer')]: mockModulePath
}
}
})
bundleAnalyzer.ts
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
const plugin = new BundleAnalyzerPlugin({});
export default plugin;
Figured it out, ...config was overwriting my plugin 🙂
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.