Skip to content

Commit

Permalink
fix: window
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed May 9, 2022
1 parent 87ffdcc commit 9a65f8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vite/src/node/plugins/dynamicImportVars.ts
Expand Up @@ -83,11 +83,12 @@ export async function transformDynamicImport(
return null
}
const relativeFileName = posix.relative(
posix.dirname(normalizePath(importer)),
normalizePath(resolvedFileName)
posix.dirname(importer),
resolvedFileName
)
importSource =
importSource = normalizePath(
'`' + (relativeFileName[0] === '.' ? '' : './') + relativeFileName + '`'
)
}

const dynamicImportPattern = parseDynamicImportPattern(importSource)
Expand Down

0 comments on commit 9a65f8e

Please sign in to comment.