Skip to content

Commit

Permalink
refactor: move configLoader validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Dec 9, 2024
1 parent 9b2179a commit 8669489
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,12 @@ export async function loadConfigFromFile(
config: UserConfig
dependencies: string[]
} | null> {
if (configLoader !== 'bundle' && configLoader !== 'runner') {
throw new Error(
`Unsupported configLoader: ${configLoader}. Accepted values are 'bundle' and 'runner'.`,
)
}

const start = performance.now()
const getTime = () => `${(performance.now() - start).toFixed(2)}ms`

Expand All @@ -1671,12 +1677,6 @@ export async function loadConfigFromFile(
return null
}

if (configLoader !== 'bundle' && configLoader !== 'runner') {
throw new Error(
`Unsupported configLoader: ${configLoader}. Accepted values are 'bundle' and 'runner'.`,
)
}

try {
const resolver =
configLoader === 'bundle' ? bundleAndLoadConfigFile : importConfigFile
Expand Down

0 comments on commit 8669489

Please sign in to comment.