Skip to content

Instantly share code, notes, and snippets.

@arijitMondal
Last active September 16, 2020 17:22
Show Gist options
  • Save arijitMondal/6234f5ce71970132da012b4a40c4f996 to your computer and use it in GitHub Desktop.
Save arijitMondal/6234f5ce71970132da012b4a40c4f996 to your computer and use it in GitHub Desktop.
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
if (ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: isServer ? 8888 : 8889,
openAnalyzer: true,
})
)
}
return config
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment