Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Mar 23, 2023
1 parent 831c601 commit aee1e16
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/node/plugins/resolve.ts
Expand Up @@ -536,8 +536,7 @@ function tryCleanFsResolve(
const fileStat = tryStatSync(file)

// Try direct match first
if (fileStat?.isFile())
return getRealPath(file, options.preserveSymlinks)
if (fileStat?.isFile()) return getRealPath(file, options.preserveSymlinks)

let res: string | undefined

Expand All @@ -546,7 +545,7 @@ function tryCleanFsResolve(
if (possibleJsToTs || extensions.length || tryPrefix) {
const dirPath = path.dirname(file)
const dirStat = tryStatSync(dirPath)
if (dirStat && dirStat.isDirectory()) {
if (dirStat?.isDirectory()) {
if (possibleJsToTs) {
// try resolve .js, .mjs, .mts or .jsx import to typescript file
const tsSrcPaths = getPotentialTsSrcPaths(file)
Expand Down

0 comments on commit aee1e16

Please sign in to comment.