From 7047e1112a8e0a292a222e6bda2f5038e7d5286b Mon Sep 17 00:00:00 2001 From: Trung-Tin Pham <60747384+AtelyPham@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:05:21 +0700 Subject: [PATCH] fix: parse and set the bridge env vars in webpack --- apps/bridge-dapp/webpack.base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/bridge-dapp/webpack.base.js b/apps/bridge-dapp/webpack.base.js index ecd62dd73d..2dc167e553 100644 --- a/apps/bridge-dapp/webpack.base.js +++ b/apps/bridge-dapp/webpack.base.js @@ -67,7 +67,7 @@ function createWebpack(env, mode = 'production') { const bridgeEnvVars = Object.keys(process.env) .filter((key) => key.startsWith('BRIDGE_DAPP_')) .reduce((envVars, key) => { - envVars[key] = JSON.stringify(process.env[key]); + envVars[`process.env.${key}`] = JSON.stringify(process.env[key]); return envVars; }, {}); @@ -257,9 +257,9 @@ function createWebpack(env, mode = 'production') { resourceRegExp: /^\.\/locale$/, }), new webpack.DefinePlugin({ - 'process.env': JSON.stringify(bridgeEnvVars), 'process.env.BRIDGE_VERSION': JSON.stringify(packageVersion), 'process.env.NODE_ENV': JSON.stringify(mode), + ...bridgeEnvVars, }), new webpack.optimize.SplitChunksPlugin(), new MiniCssExtractPlugin({