Skip to content

Commit e6c1c15

Browse files
author
Bernie Zang
committed
fix(tooling): Whitelist env vars
1 parent 0a41404 commit e6c1c15

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

scripts/webpack/webpack.base.babel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import path from 'path';
22
import webpack from 'webpack';
33
import ExtractTextPlugin from 'extract-text-webpack-plugin';
4-
import InlineEnviromentVariablesPlugin from 'inline-environment-variables-webpack-plugin';
54
import dotenv from 'dotenv';
65

76
dotenv.config();
87

98
export default (options) => {
109
const packageJson = require(`../../package.json`);
1110
const plugins = [
12-
new InlineEnviromentVariablesPlugin(Object.assign(process.env, options.env)),
11+
new webpack.EnvironmentPlugin([
12+
`NODE_ENV`
13+
]),
1314
new ExtractTextPlugin({filename: `[name].css`, disable: false, allChunks: true}),
1415
// Adds use strict to prevent catch global namespace issues outside of chunks.
1516
new webpack.BannerPlugin(`react-ciscospark v${packageJson.version}`)

scripts/webpack/webpack.dev.babel.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
* webpack dev server and we are bundling into a single js file.
44
*/
55

6+
import webpack from 'webpack';
67
import webpackConfigBase from './webpack.base.babel';
78
import HtmlWebpackPlugin from 'html-webpack-plugin';
89

9-
1010
const plugins = [
1111
new HtmlWebpackPlugin({
1212
template: `index.html`
13-
})
13+
}),
14+
new webpack.EnvironmentPlugin([
15+
`CISCOSPARK_ACCESS_TOKEN`,
16+
`TO_PERSON_EMAIL`,
17+
`TO_PERSON_ID`
18+
])
1419
];
1520

1621
export default webpackConfigBase({

0 commit comments

Comments
 (0)