From 55a012f3c259cb7d2ffa59e502515a8b9cd28054 Mon Sep 17 00:00:00 2001 From: vinu-deriv Date: Wed, 12 Apr 2023 11:15:50 +0400 Subject: [PATCH] fix: change to include env variables in build only when environment other than development --- packages/bot-web-ui/webpack.config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/bot-web-ui/webpack.config.js b/packages/bot-web-ui/webpack.config.js index 38ce200fe21c..0e2830e5014a 100644 --- a/packages/bot-web-ui/webpack.config.js +++ b/packages/bot-web-ui/webpack.config.js @@ -119,11 +119,15 @@ module.exports = function (env) { }, plugins: [ new Dotenv(), - new DefinePlugin({ - 'process.env.GD_CLIENT_ID': JSON.stringify(process.env.GD_CLIENT_ID), - 'process.env.GD_API_KEY': JSON.stringify(process.env.GD_API_KEY), - 'process.env.GD_APP_ID': JSON.stringify(process.env.GD_APP_ID), - }), + ...(process.env.NODE_ENV !== 'development' + ? [] + : [ + new DefinePlugin({ + 'process.env.GD_CLIENT_ID': JSON.stringify(process.env.GD_CLIENT_ID), + 'process.env.GD_API_KEY': JSON.stringify(process.env.GD_API_KEY), + 'process.env.GD_APP_ID': JSON.stringify(process.env.GD_APP_ID), + }), + ]), new CleanWebpackPlugin(), new MiniCssExtractPlugin({ filename: 'bot/css/bot.main.[contenthash].css',