Files
gitlab-instance-0a899031_el…/.erb/scripts/check-node-env.js
hackrobot 769ed60311
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Publish / publish (macos-latest) (push) Has been cancelled
Test / test (macos-latest) (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
Test / test (windows-latest) (push) Has been cancelled
init
2024-04-06 18:02:46 +08:00

17 lines
381 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);
}
}