Skip to content

Commit

Permalink
fix: change to include env variables in build only when environment o…
Browse files Browse the repository at this point in the history
…ther than development
  • Loading branch information
vinu-deriv committed Apr 12, 2023
1 parent c19c2cb commit 55a012f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/bot-web-ui/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 55a012f

Please sign in to comment.