From 2eff310a77beae9bb9ecf38abc55cca94c65fbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Schmelczer?= Date: Mon, 24 Jan 2022 23:14:24 +0100 Subject: [PATCH] Fix webpack reload infinite loop --- webpack.config.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 5945a5a..5d43b22 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,14 +29,15 @@ module.exports = (env, argv) => ({ template: './src/index.html', }), new MiniCssExtractPlugin(), - new InlineSourceWebpackPlugin({ - compress: true, - }), + argv.mode === 'production' + ? new InlineSourceWebpackPlugin({ + compress: true, + }) + : null, new webpack.DefinePlugin({ __CURRENT_DATE__: Date.now(), }), - ], - + ].filter(Boolean), module: { rules: [ { @@ -105,9 +106,7 @@ module.exports = (env, argv) => ({ { test: /\.ts$/, use: [ - { - loader: 'ts-loader', - }, + 'ts-loader', { // for removing whitespace from template strings loader: 'string-replace-loader',