Skip to content

Commit

Permalink
Fix issue with moving env to helm chart (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhikaPPatel authored Nov 8, 2021
1 parent 6550ac0 commit 92f815d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"start": "webpack-dev-server --mode development",
"build:dev": "webpack --mode development --env.build=dev",
"start:dev": "webpack-dev-server --mode development --env.build=dev",
"start:local": "webpack-dev-server --mode development --env.build=local",
"build:prod": "webpack --mode development --env.build=prod",
"start:prod": "webpack-dev-server --mode development --env.build=prod",
"test": "jest --watch",
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<body>
<div id="root"></div>
<script type="text/javascript" src="/environment.js"></script>
</body>

</html>
11 changes: 8 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ const HtmlWebPackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = (env, argv) => {
const fileCopy = env.build === 'local'
? new CopyPlugin([
{ from: '.env.development.local', to: 'environment.js' },
])
: new CopyPlugin([
{ from: 'window.environment.js', to: 'environment.js' },
]);
const webpackConfig = {
entry: ['babel-polyfill', './src/index.js'],
module: {
Expand Down Expand Up @@ -106,9 +113,7 @@ module.exports = (env, argv) => {
favicon: './src/assets/favicon.ico',
hash: true,
}),
new CopyPlugin([
{ from: 'window.environment.js', to: 'environment.js' },
]),
fileCopy,
],
};

Expand Down

0 comments on commit 92f815d

Please sign in to comment.