From c0ad0ec7b1512254dbd7b47860fdbbf84000559e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 14 Dec 2023 19:41:46 +0100 Subject: [PATCH] set different output path depending on mode --- config/webpack.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index 640cc920df45..3d581aeb02e5 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -219,8 +219,13 @@ const pluginConfig = function(plugin) { ); }); + if (config.mode == 'production') { + var outputPath = path.join(pluginRoot, 'public', 'webpack', pluginName); + } else { + var outputPath = path.join(__dirname, '..', 'public', 'webpack', pluginName); + } config.output = { - path: path.join(pluginRoot, 'public', 'webpack', pluginName), + path: outputPath, publicPath: '/webpack/' + pluginName + '/', uniqueName: pluginName, };