Skip to content

Commit

Permalink
fix: don't remove user defines (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Feb 18, 2022
1 parent bfff0e1 commit e2d2fac
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/vitest/src/node/plugins/index.ts
Expand Up @@ -92,16 +92,6 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest())
)
options.api = resolveApiConfig(options)

// we cannot replace them, because esbuild will throw an error,
// so we are removing them to allow reassigning
const define = viteConfig.define

if (define) {
delete define['process.env.NODE_ENV']
delete define['global.process.env.NODE_ENV']
delete define['globalThis.process.env.NODE_ENV']
}

// we replace every "import.meta.env" with "process.env"
// to allow reassigning, so we need to put all envs on process.env
const { PROD, DEV, ...envs } = viteConfig.env
Expand Down

0 comments on commit e2d2fac

Please sign in to comment.