Skip to content

Commit

Permalink
fix: should load --config foo.mjs as an ES module (#5091)
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Sep 26, 2021
1 parent 1bf759d commit 5d2c50a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/config.ts
Expand Up @@ -772,6 +772,10 @@ export async function loadConfigFromFile(
// explicit config path is always resolved from cwd
resolvedPath = path.resolve(configFile)
isTS = configFile.endsWith('.ts')

if (configFile.endsWith('.mjs')) {
isMjs = true
}
} else {
// implicit config file loaded from inline root (if present)
// otherwise from cwd
Expand Down

0 comments on commit 5d2c50a

Please sign in to comment.