Skip to content

Commit

Permalink
fix: exclude variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Sep 25, 2023
1 parent 8509b58 commit 6b43ba7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
}
return
} else if (templateLiteralRE.test(rawUrl)) {
// Only static template literal will into this branch.
// It has variables will processed in importMetaGlob.ts
specifier = rawUrl.replace(templateLiteralRE, '$1')
if (!rawUrl.includes('${') && !rawUrl.includes('}')) {
specifier = rawUrl.replace(templateLiteralRE, '$1')
}
}

const isDynamicImport = dynamicIndex > -1
Expand Down

0 comments on commit 6b43ba7

Please sign in to comment.