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.
17 lines
425 B
17 lines
425 B
// @flow
|
|
import chalk from 'chalk'
|
|
|
|
export default function CheckNodeEnv(expectedEnv: string) {
|
|
if (!expectedEnv) {
|
|
throw new Error('"expectedEnv" not set')
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== expectedEnv) {
|
|
/* eslint-disable */
|
|
console.log(chalk.whiteBright.bgRed.bold(
|
|
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`
|
|
))
|
|
/* eslint-enable */
|
|
process.exit(2)
|
|
}
|
|
}
|
|
|