Skip to content

Commit

Permalink
fix(config): detect TS when configPath is provided (#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox authored Nov 30, 2020
1 parent 18c2c6f commit fca0892
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ export async function resolveConfig(mode: string, configPath?: string) {
const cwd = process.cwd()

let resolvedPath: string | undefined
let isTS = false
if (configPath) {
resolvedPath = path.resolve(cwd, configPath)
} else {
Expand All @@ -498,7 +497,6 @@ export async function resolveConfig(mode: string, configPath?: string) {
} else {
const tsConfigPath = path.resolve(cwd, 'vite.config.ts')
if (fs.existsSync(tsConfigPath)) {
isTS = true
resolvedPath = tsConfigPath
}
}
Expand All @@ -511,6 +509,8 @@ export async function resolveConfig(mode: string, configPath?: string) {
}
}

const isTS = resolvedPath.endsWith('.ts')

try {
let userConfig: UserConfig | ((mode: string) => UserConfig) | undefined

Expand Down

0 comments on commit fca0892

Please sign in to comment.