Use NODE_ENV from environment instead of overriding it
This commit is contained in:
13
webpack/index.js
Normal file
13
webpack/index.js
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user