Nuxt/packages/nuxi/src/utils/env.ts

9 lines
300 B
TypeScript
Raw Normal View History

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
}