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
  • Loading branch information
hyf0 authored and aleclarson committed Nov 8, 2021
1 parent ec7fc3a commit 72c08b4
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 72c08b4

Please sign in to comment.