From 3d17042b3c2b74f7ec6f018573e574cc6526ae89 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Wed, 27 Feb 2019 17:55:26 +0100 Subject: [PATCH 1/4] fix webpack environment variables Signed-off-by: Karoly Albert Szabo --- CHANGELOG.md | 1 + webpack.renderer.config.js | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 740c2d0142..4f29745131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [\#2015](https://github.com/cosmos/voyager/issues/2015) fixed error that showed wrong message when Ledger's screensaver mode was on @fedekunze - Reconnected event was not triggered after reconnection @faboweb - [\#2094](https://github.com/cosmos/voyager/pull/2094) fix Toolbar @faboweb +- Fix Webpack Env variables @sabau ### Changed diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index d51f2c7945..b0b562066a 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -117,11 +117,7 @@ const rendererConfig = { new webpack.DefinePlugin({ "process.env.RELEASE": `"${commitHash}"` }), - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: JSON.stringify(process.env.NODE_ENV) - } - }), + new webpack.EnvironmentPlugin([`NODE_ENV`, `RELEASE`, `STARGATE`, `RPC`, `RELEASE`]), new HtmlWebpackPlugin({ filename: `index.html`, template: `./app/index.ejs`, From eaff574cd5dda0f1b7467e60e86b5f740d7a694e Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Thu, 28 Feb 2019 10:29:09 +0100 Subject: [PATCH 2/4] faucet deserve his places in the olympus of the env variables Signed-off-by: Karoly Albert Szabo --- webpack.renderer.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index b0b562066a..48c0e24bb3 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -117,7 +117,7 @@ const rendererConfig = { new webpack.DefinePlugin({ "process.env.RELEASE": `"${commitHash}"` }), - new webpack.EnvironmentPlugin([`NODE_ENV`, `RELEASE`, `STARGATE`, `RPC`, `RELEASE`]), + new webpack.EnvironmentPlugin([`NODE_ENV`, `RELEASE`, `STARGATE`, `RPC`, `RELEASE`, `FAUCET`]), new HtmlWebpackPlugin({ filename: `index.html`, template: `./app/index.ejs`, From 0dda8c563dd3573fccbe1b69c27f079e0677b881 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Thu, 28 Feb 2019 11:39:56 +0100 Subject: [PATCH 3/4] revert to DefinePlugin, we have more control - Different behaviour for falsey values like empty strings on different OS --- webpack.renderer.config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index 48c0e24bb3..155a0285aa 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -115,9 +115,14 @@ const rendererConfig = { "global.GENTLY": false }), new webpack.DefinePlugin({ - "process.env.RELEASE": `"${commitHash}"` - }), - new webpack.EnvironmentPlugin([`NODE_ENV`, `RELEASE`, `STARGATE`, `RPC`, `RELEASE`, `FAUCET`]), + "process.env": { + NODE_ENV: JSON.stringify(process.env.NODE_ENV), + FAUCET: JSON.stringify(process.env.FAUCET), + RPC: JSON.stringify(process.env.RPC), + STARGATE: JSON.stringify(process.env.STARGATE), + RELEASE: JSON.stringify(commitHash) + } + }), new HtmlWebpackPlugin({ filename: `index.html`, template: `./app/index.ejs`, @@ -206,4 +211,4 @@ if (process.env.RELEASE) { ) } -module.exports = rendererConfig \ No newline at end of file +module.exports = rendererConfig From fe5405527bd803cbbd660967a8136e359b4342f7 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Thu, 28 Feb 2019 11:40:16 +0100 Subject: [PATCH 4/4] Update webpack.renderer.config.js --- webpack.renderer.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index 155a0285aa..8c43c98ebe 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -122,7 +122,7 @@ const rendererConfig = { STARGATE: JSON.stringify(process.env.STARGATE), RELEASE: JSON.stringify(commitHash) } - }), + }), new HtmlWebpackPlugin({ filename: `index.html`, template: `./app/index.ejs`,