mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-14 12:48:16 +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
|
|
}
|