diff --git a/.dev-env b/.dev-env deleted file mode 100644 index 4704c2d065fb35d932b5e7d00d9d42ffcd40a6f1..0000000000000000000000000000000000000000 --- a/.dev-env +++ /dev/null @@ -1 +0,0 @@ -API_BASE_URL="http://apply.localhost:8000" diff --git a/opentech/static_src/src/app/webpack.base.config.js b/opentech/static_src/src/app/webpack.base.config.js index 8d1aa48a52fdb4364ce01ee5381bd7215f36f3c7..74ed1fe33dc686851ac528c550e589d15395f6a6 100644 --- a/opentech/static_src/src/app/webpack.base.config.js +++ b/opentech/static_src/src/app/webpack.base.config.js @@ -10,9 +10,7 @@ module.exports = { filename: '[name]-[hash].js' }, - plugins: [ - new Dotenv(), - ], + plugins: [], module: { rules: [ diff --git a/opentech/static_src/src/app/webpack.dev.config.js b/opentech/static_src/src/app/webpack.dev.config.js index 35dd1193a7f3b4b938cdc37f2dc6db6f1b495211..73fedc45ccced2de49d461670e6207ad45f6f57a 100644 --- a/opentech/static_src/src/app/webpack.dev.config.js +++ b/opentech/static_src/src/app/webpack.dev.config.js @@ -13,8 +13,8 @@ config.plugins = config.plugins.concat([ new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), new BundleTracker({filename: './opentech/static_compiled/app/webpack-stats.json'}), - new Dotenv({ - path: '.dev-env', + new webpack.EnvironmentPlugin({ + API_BASE_URL: 'http://apply.localhost:8000/', }), ]) diff --git a/opentech/static_src/src/app/webpack.prod.config.js b/opentech/static_src/src/app/webpack.prod.config.js index 9b0ff64acf263045ea57e046147492c9f347a7d2..9f85413c07e0cc3b652e0fb7135b675e634dfe07 100644 --- a/opentech/static_src/src/app/webpack.prod.config.js +++ b/opentech/static_src/src/app/webpack.prod.config.js @@ -7,12 +7,10 @@ config.output.path = require('path').resolve('./assets/dist') config.plugins = config.plugins.concat([ new BundleTracker({filename: './opentech/static_compiled/app/webpack-stats-prod.json'}), - - // removes a lot of debugging code in React - new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify('production') - }}), + new webpack.EnvironmentPlugin({ + NODE_ENV: 'production', + API_BASE_URL: null , + }), ]) config.optimization = { diff --git a/package-lock.json b/package-lock.json index f24c1d4debbff7d6956d5bd90318a5d8050f0ea8..20f5a048a4296536a409c71a33cc00f095e9ab04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3065,25 +3065,6 @@ "domelementtype": "1" } }, - "dotenv": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz", - "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==" - }, - "dotenv-expand": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-4.2.0.tgz", - "integrity": "sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU=" - }, - "dotenv-webpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/dotenv-webpack/-/dotenv-webpack-1.6.0.tgz", - "integrity": "sha512-jTbHXmcVw3KMVhTdgthYNLWWHRGtucrADpZWwVCdiP+pCvuWvxLcUadwEnmz8Wqv/d2UAJxJhp1jrxGlMYCetg==", - "requires": { - "dotenv": "^5.0.1", - "dotenv-expand": "^4.0.1" - } - }, "duplexer": { "version": "0.1.1", "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", diff --git a/package.json b/package.json index abcc5c13046fd4abf73bd0df29090dfa5a3f0145..d1dc670a25bdc1440792d8c521ab9a13fe41c74c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "@babel/polyfill": "^7.2.5", "@svgr/webpack": "^4.1.0", "del": "^3.0.0", - "dotenv-webpack": "^1.6.0", "gulp": "^4.0.0", "gulp-babel": "^8.0.0", "gulp-clean-css": "^3.10.0",