diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-05-15 20:59:37 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-05-15 20:59:37 -0400 |
commit | 08b6bf8b51ab631c8cfe9c3e12bfb0ae2dd7b4c7 (patch) | |
tree | 4da12c24cf297f19767d6ce4f39da2fe123c922f /webpack.config.js | |
parent | b9a3c4adb81b38f550f0ab18be5c40a38aea4597 (diff) | |
parent | 28985a26b4f852dffeb02a43d135776314a1f600 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/webpack.config.js b/webpack.config.js index 480ed7aa3..bd1d3b5a9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,7 +16,7 @@ const plugins = [ new webpack.HotModuleReplacementPlugin(), ]; -(function transferEnvironmentVariables() { +function transferEnvironmentVariables() { const prefix = "_CLIENT_"; const { parsed @@ -24,13 +24,16 @@ const plugins = [ if (!parsed) { return; } - plugins.push(new webpack.DefinePlugin(Object.keys(parsed).reduce((mapping, envKey) => { + const resolvedClientSide = Object.keys(parsed).reduce((mapping, envKey) => { if (envKey.startsWith(prefix)) { mapping[`process.env.${envKey.replace(prefix, "")}`] = JSON.stringify(parsed[envKey]); } return mapping; - }, {}))); -})(); + }, {}); + plugins.push(new webpack.DefinePlugin(resolvedClientSide)); +} + +transferEnvironmentVariables(); module.exports = { mode: 'development', |