Run bundle analyzer only in dev

This commit is contained in:
Alfred Melch 2019-12-14 13:50:17 +01:00
parent 6ce1e75c21
commit 9659655e27

View File

@ -63,7 +63,6 @@ module.exports = (env, argv) => {
// show a progress bar // show a progress bar
new WebpackBar(), new WebpackBar(),
// create a report.html for bundle size // create a report.html for bundle size
new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false }),
// extract css to css files // extract css to css files
isEnvProduction && isEnvProduction &&
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
@ -76,6 +75,11 @@ module.exports = (env, argv) => {
cssProcessorOptions: { cssProcessorOptions: {
map: { inline: false, annotation: true } map: { inline: false, annotation: true }
} }
}),
isEnvDevelopment &&
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false
}) })
// hot reload not working right now // hot reload not working right now
// isEnvDevelopment && // isEnvDevelopment &&