diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index cb3743395be4cd..e5e3608f7c723c 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -480,7 +480,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { // static import or valid string in dynamic import // If resolvable, let's resolve it - if (specifier) { + if (specifier !== undefined) { // skip external / data uri if (isExternalUrl(specifier) || isDataUrl(specifier)) { return