Skip to content

Commit

Permalink
fix: avoid replacing process.env member expression
Browse files Browse the repository at this point in the history
fix #930
  • Loading branch information
yyx990803 committed Jan 6, 2021
1 parent 7a9aba5 commit c8f4bb9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/node/plugins/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ export function buildDefinePlugin(config: ResolvedConfig): Plugin {
...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.': `({}).`,
'process.env': JSON.stringify({ NODE_ENV: config.mode }),
'import.meta.hot': `false`
'process.env.': `({}).`
}

const pattern = new RegExp(
Expand Down

0 comments on commit c8f4bb9

Please sign in to comment.