Skip to content

Commit

Permalink
fix: prevent production node_env in serve (#9066)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jul 13, 2022
1 parent f020066 commit 7662998
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/config.ts
Expand Up @@ -360,6 +360,10 @@ export async function resolveConfig(
if (mode === 'production') {
process.env.NODE_ENV = 'production'
}
// production env would not work in serve, fallback to development
if (command === 'serve' && process.env.NODE_ENV === 'production') {
process.env.NODE_ENV = 'development'
}

const configEnv = {
mode,
Expand Down

0 comments on commit 7662998

Please sign in to comment.