2017-06-28 21:16:21 +02:00
|
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
|
|
|
|
const { ANALYZE } = process.env
|
|
|
|
|
2017-02-14 03:24:50 +01:00
|
|
|
module.exports = {
|
2017-06-28 21:16:21 +02:00
|
|
|
webpack: function (config) {
|
|
|
|
if (ANALYZE) {
|
|
|
|
config.plugins.push(new BundleAnalyzerPlugin({
|
|
|
|
analyzerMode: 'server',
|
|
|
|
analyzerPort: 8888,
|
|
|
|
openAnalyzer: true
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
|
2017-02-14 03:24:50 +01:00
|
|
|
return config
|
|
|
|
}
|
|
|
|
}
|