diff --git a/packages/vant-cli/src/compiler/get-deps.ts b/packages/vant-cli/src/compiler/get-deps.ts index 13d1d8848..363ea6118 100644 --- a/packages/vant-cli/src/compiler/get-deps.ts +++ b/packages/vant-cli/src/compiler/get-deps.ts @@ -9,7 +9,8 @@ let existsCache: Record = {}; const IMPORT_RE = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g; function matchImports(code: string): string[] { - return code.match(IMPORT_RE) || []; + const imports = code.match(IMPORT_RE) || []; + return imports.filter((line) => !line.includes('import type')); } function exists(filePath: string) {