Skip to content

Commit

Permalink
fix: parse and set the bridge env vars in webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham authored Jul 27, 2023
1 parent b1678c5 commit 7047e11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/bridge-dapp/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}, {});

Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 7047e11

Please sign in to comment.