diff --git a/webpack.config.dev.js b/webpack.config.dev.js index 67127f20..6322d420 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -34,15 +34,15 @@ module.exports = { }), new webpack.DefinePlugin({ 'process.env': { - API_URL: '"' + process.env.API_URL + '"', + API_URL: process.env.API_URL ? '"' + process.env.API_URL + '"' : undefined, CLIENT: JSON.stringify(true), FORCE_TO_HTTPS: process.env.FORCE_TO_HTTPS === 'true' ? JSON.stringify(true) : JSON.stringify(false), 'NODE_ENV': JSON.stringify('development'), - 'S3_BUCKET': '"' + process.env.S3_BUCKET + '"', - 'S3_BUCKET_URL_BASE': '"' + process.env.S3_BUCKET_URL_BASE + '"', - 'AWS_REGION': '"' + process.env.AWS_REGION + '"', + 'S3_BUCKET': process.env.S3_BUCKET ? '"' + process.env.S3_BUCKET + '"' : undefined, + 'S3_BUCKET_URL_BASE': process.env.S3_BUCKET_URL_BASE ? '"' + process.env.S3_BUCKET_URL_BASE + '"' : undefined, + 'AWS_REGION': process.env.AWS_REGION ? '"' + process.env.AWS_REGION + '"': undefined } }) ], diff --git a/webpack.config.prod.js b/webpack.config.prod.js index e5f9d037..3972c212 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -79,11 +79,11 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ 'process.env': { - 'API_URL': '"' + process.env.API_URL + '"', + 'API_URL': process.env.API_URL ? '"' + process.env.API_URL + '"' : undefined, 'NODE_ENV': JSON.stringify('production'), - 'S3_BUCKET': '"' + process.env.S3_BUCKET + '"', - 'S3_BUCKET_URL_BASE': '"' + process.env.S3_BUCKET_URL_BASE + '"', - 'AWS_REGION': '"' + process.env.AWS_REGION + '"' + 'S3_BUCKET': process.env.S3_BUCKET ? '"' + process.env.S3_BUCKET + '"' : undefined, + 'S3_BUCKET_URL_BASE': process.env.S3_BUCKET_URL_BASE ? '"' + process.env.S3_BUCKET_URL_BASE + '"' : undefined, + 'AWS_REGION': process.env.AWS_REGION ? '"' + process.env.AWS_REGION + '"': undefined } }), new webpack.optimize.CommonsChunkPlugin({