We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01cbea8 commit 6fec6abCopy full SHA for 6fec6ab
1 file changed
packages/vite/src/node/plugins/importAnalysis.ts
@@ -470,6 +470,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
470
}
471
return
472
} else if (templateLiteralRE.test(rawUrl)) {
473
+ // If the import has backticks but isn't transformed as a glob import
474
+ // (as there's nothing to glob), check if it's simply a plain string.
475
+ // If so, we can replace the specifier as a plain string to prevent
476
+ // an incorrect "cannot be analyzed" warning.
477
if (!(rawUrl.includes('${') && rawUrl.includes('}'))) {
478
specifier = rawUrl.replace(templateLiteralRE, '$1')
479
0 commit comments