Skip to content

Commit

Permalink
Merge branch 'fix-sass-import' of github.com:daychongyang/vite into f…
Browse files Browse the repository at this point in the history
…ix-sass-import
  • Loading branch information
daychongyang committed May 29, 2020
2 parents 35fc460 + 4afa68c commit 09abb62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/node/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ export function resolveNodeModuleFile(
}
}

const normalize = path.posix.normalize

/**
* given a relative path in pkg dir,
* return a relative path in pkg dir,
Expand All @@ -410,13 +412,13 @@ function mapWithBrowserField(
relativePathInPkgDir: string,
map: Record<string, string>
) {
const normalized = path.normalize(relativePathInPkgDir)
const normalized = normalize(relativePathInPkgDir)
const foundEntry = Object.entries(map).find(([from]) => {
return path.normalize(from) === normalized
return normalize(from) === normalized
})
if (!foundEntry) {
return normalized
}
const [, to] = foundEntry
return path.normalize(to)
return normalize(to)
}
1 change: 0 additions & 1 deletion src/node/server/serverPluginModuleRewrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ export const resolveImport = (
// 3. resolve extensions.
const ext = resolver.resolveExt(pathname)
if (ext) {
// in aliased cases the inferred ext can contain multiple slashes
pathname = path.posix.normalize(pathname + ext)
}

Expand Down

0 comments on commit 09abb62

Please sign in to comment.