mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 10:54:49 +00:00
9 lines
300 B
TypeScript
9 lines
300 B
TypeScript
export const overrideEnv = (targetEnv: string) => {
|
|
const currentEnv = process.env.NODE_ENV
|
|
if (currentEnv && currentEnv !== targetEnv) {
|
|
console.warn(`Changing \`NODE_ENV\` from \`${currentEnv}\` to \`${targetEnv}\`, to avoid unintended behavior.`)
|
|
}
|
|
|
|
process.env.NODE_ENV = targetEnv
|
|
}
|