Skip to content

Commit

Permalink
fix(define): ensure the normal use of NODE_ENV, fix #2759 (#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 31, 2021
1 parent 34bd628 commit fa85749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/define.ts
Expand Up @@ -31,7 +31,7 @@ export function definePlugin(config: ResolvedConfig): Plugin {
}

const replacements: Record<string, string | undefined> = {
'process.env.NODE_ENV': JSON.stringify(config.mode),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || config.mode),
...userDefine,
...importMetaKeys,
'process.env.': `({}).`
Expand Down

0 comments on commit fa85749

Please sign in to comment.