You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
485 B
22 lines
485 B
2 years ago
|
import dotenv from 'dotenv';
|
||
|
|
||
|
import type { Configuration } from 'webpack';
|
||
|
|
||
|
dotenv.config();
|
||
4 years ago
|
|
||
|
const { NODE_ENV } = process.env;
|
||
|
|
||
2 years ago
|
let configuration: Configuration = {};
|
||
|
|
||
2 years ago
|
switch (NODE_ENV) {
|
||
2 years ago
|
case 'development':
|
||
|
case 'production':
|
||
|
case 'test':
|
||
2 years ago
|
configuration = require(`./webpack/${NODE_ENV}`).default;
|
||
|
break;
|
||
2 years ago
|
default:
|
||
|
console.error('ERROR: NODE_ENV must be set to either `development`, `test`, or `production`.');
|
||
|
process.exit(1);
|
||
4 years ago
|
}
|
||
2 years ago
|
|
||
|
export default configuration;
|