Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed May 9, 2022
1 parent 5d11b74 commit 4ace630
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/vite/src/node/plugins/dynamicImportVars.ts
Expand Up @@ -34,13 +34,12 @@ const dynamicImportHelper = (glob: Record<string, any>, path: string) => {
}

function parseDynamicImportPattern(
strings: string
filename: string
): DynamicImportPattern | null {
const filename = strings.slice(1, -1)
const rawQuery = parseRequest(filename)
let globParams: DynamicImportRequest | null = null
const ast = (
parseJS(strings, {
parseJS(`\`${filename}\``, {
ecmaVersion: 'latest',
sourceType: 'module'
}) as any
Expand Down Expand Up @@ -86,9 +85,7 @@ export async function transformDynamicImport(
posix.dirname(normalizePath(importer)),
normalizePath(resolvedFileName)
)
importSource = normalizePath(
'`' + (relativeFileName[0] === '.' ? '' : './') + relativeFileName + '`'
)
importSource = (relativeFileName[0] === '.' ? '' : './') + relativeFileName
}

const dynamicImportPattern = parseDynamicImportPattern(importSource)
Expand Down

0 comments on commit 4ace630

Please sign in to comment.