Skip to content

Commit

Permalink
fix(import-glob): alias pattern in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Feb 27, 2023
1 parent 302b068 commit 2d5c458
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/plugins/importMetaGlob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,12 @@ export async function transformGlobImport(
files.forEach((file, i) => {
const paths = resolvePaths(file)
const filePath = paths.filePath
const safeFile = globSafePath(file)
const aliasPath =
aliasPattern &&
typeof aliasPattern.find === 'string' &&
file.replace(aliasPattern.replacement, aliasPattern.find)
const aliasMatched = aliasPath && aliasPath !== file
safeFile.replace(aliasPattern.replacement, aliasPattern.find)
const aliasMatched = aliasPath && aliasPath !== safeFile
let importPath = paths.importPath
let importQuery = query

Expand Down

0 comments on commit 2d5c458

Please sign in to comment.