From 01ce288a549e79aa500ae45d10bc227a445f6989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Tue, 11 Jun 2024 23:32:06 +0200 Subject: [PATCH] frontend: Optimize production builds (#795) --- frontend/config/webpack.common.js | 4 ++-- frontend/config/webpack.dev.js | 2 +- frontend/config/webpack.prod.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/config/webpack.common.js b/frontend/config/webpack.common.js index 4975ff27..3fdda13f 100644 --- a/frontend/config/webpack.common.js +++ b/frontend/config/webpack.common.js @@ -6,7 +6,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const {CleanWebpackPlugin} = require('clean-webpack-plugin'); -module.exports = (withDebug) => { +module.exports = (withDebug, optimize) => { return { entry: './src/index.js', output: { @@ -45,7 +45,7 @@ module.exports = (withDebug) => { options: { // add Elm's debug overlay to output debug: withDebug, - optimize: false + optimize: optimize, } } ] diff --git a/frontend/config/webpack.dev.js b/frontend/config/webpack.dev.js index f8cea713..1d3bcf57 100644 --- a/frontend/config/webpack.dev.js +++ b/frontend/config/webpack.dev.js @@ -29,5 +29,5 @@ const dev = { module.exports = env => { const withDebug = !env.nodebug; - return merge(common(withDebug), dev); + return merge(common(withDebug, false), dev); } diff --git a/frontend/config/webpack.prod.js b/frontend/config/webpack.prod.js index f293232b..5eb51db5 100644 --- a/frontend/config/webpack.prod.js +++ b/frontend/config/webpack.prod.js @@ -61,4 +61,4 @@ const prod = { }; -module.exports = merge(common(false), prod); +module.exports = merge(common(false, true), prod);