bigbuffet-rw/webpack.config.ts

22 lines
485 B
TypeScript
Raw Normal View History

import dotenv from 'dotenv';
import type { Configuration } from 'webpack';
dotenv.config();
const { NODE_ENV } = process.env;
let configuration: Configuration = {};
switch (NODE_ENV) {
2022-05-11 14:06:35 -07:00
case 'development':
case 'production':
case 'test':
configuration = require(`./webpack/${NODE_ENV}`).default;
break;
2022-05-11 14:06:35 -07:00
default:
console.error('ERROR: NODE_ENV must be set to either `development`, `test`, or `production`.');
process.exit(1);
}
export default configuration;