1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2025-07-18 04:33:50 +02:00
Files
Enlight/enlightApp/internals/scripts/CheckNodeEnv.js
TheGreyDiamond 015e0779a3 init
2020-11-29 17:43:34 +01:00

17 lines
379 B
JavaScript

import chalk from 'chalk';
export default function CheckNodeEnv(expectedEnv) {
if (!expectedEnv) {
throw new Error('"expectedEnv" not set');
}
if (process.env.NODE_ENV !== expectedEnv) {
console.log(
chalk.whiteBright.bgRed.bold(
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`
)
);
process.exit(2);
}
}