From 07da6d091b0a81b16f0e1d2daebc2e63cd286f14 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Sun, 24 Sep 2023 18:18:34 +0800 Subject: [PATCH] * Add watch external file plugin in dev mode only --- _scripts/webpack.renderer.config.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/_scripts/webpack.renderer.config.js b/_scripts/webpack.renderer.config.js index c0024e0bfae20..357ea20be6f32 100644 --- a/_scripts/webpack.renderer.config.js +++ b/_scripts/webpack.renderer.config.js @@ -130,11 +130,6 @@ const config = { filename: isDevMode ? '[name].css' : '[name].[contenthash].css', chunkFilename: isDevMode ? '[id].css' : '[id].[contenthash].css', }), - new WatchExternalFilesPlugin({ - files: [ - './static/locales/*.yaml', - ], - }), ], resolve: { alias: { @@ -152,4 +147,14 @@ const config = { target: 'electron-renderer', } +if (isDevMode) { + config.plugins.push( + new WatchExternalFilesPlugin({ + files: [ + './static/locales/*.yaml', + ], + }), + ) +} + module.exports = config