soapbox/webpack.config.ts

22 wiersze
485 B
TypeScript
Czysty Zwykły widok Historia

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 21:06:35 +00:00
case 'development':
case 'production':
case 'test':
configuration = require(`./webpack/${NODE_ENV}`).default;
break;
2022-05-11 21:06:35 +00:00
default:
console.error('ERROR: NODE_ENV must be set to either `development`, `test`, or `production`.');
process.exit(1);
}
export default configuration;