Use NODE_ENV from environment instead of overriding it

This commit is contained in:
Alex Gleason
2020-04-26 12:49:20 -05:00
parent 741b065d82
commit 24c7b3a6bf
8 changed files with 57 additions and 16 deletions

13
webpack/index.js Normal file
View File

@ -0,0 +1,13 @@
require('dotenv').config();
const { NODE_ENV } = process.env;
switch(NODE_ENV) {
case 'development':
case 'production':
case 'test':
module.exports = require(`./${NODE_ENV}`); break;
default:
console.error('ERROR: NODE_ENV must be set to either `development`, `test`, or `production`.');
process.exit(1);
}