Skip to content

Commit

Permalink
feat: allow user define to overwrite default process.env. defines
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 8, 2021
1 parent 7cc3cf1 commit 351ad4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/plugins/define.ts
Expand Up @@ -23,13 +23,13 @@ export function buildDefinePlugin(config: ResolvedConfig): Plugin {
}

const replacements: Record<string, string | undefined> = {
'process.env.NODE_ENV': JSON.stringify(config.mode),
'process.env.': `({}).`,
...userDefine,
...individualEnvKeys,
'import.meta.env.': `({}).`,
'import.meta.env': JSON.stringify(config.env),
'import.meta.hot': `false`,
'process.env.NODE_ENV': JSON.stringify(config.mode),
'process.env.': `({}).`
'import.meta.hot': `false`
}

const pattern = new RegExp(
Expand Down

0 comments on commit 351ad4e

Please sign in to comment.