Skip to content

Commit

Permalink
fix: overwrite configEnv.mode if the user explicitly set mode option (f…
Browse files Browse the repository at this point in the history
…ix #4441) (#4437)
  • Loading branch information
hyf0 committed Jul 31, 2021
1 parent c0a3dbf commit 7d340a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ export async function resolveConfig(
allowClearScreen: config.clearScreen
})

// user config may provide an alternative mode
mode = config.mode || mode
// user config may provide an alternative mode. But --mode has a higher prority
mode = inlineConfig.mode || config.mode || mode
configEnv.mode = mode

// resolve plugins
const rawUserPlugins = (config.plugins || []).flat().filter((p) => {
Expand Down

0 comments on commit 7d340a6

Please sign in to comment.