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.

14 lines
364 B

8 years ago
// @flow
import chalk from 'chalk'
8 years ago
export default function CheckNodeEnv(expectedEnv: string) {
if (!expectedEnv) {
throw new Error('"expectedEnv" not set')
8 years ago
}
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)
8 years ago
}
}