mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
fix(cli): ignore import types when analyzing deps (#8574)
This commit is contained in:
@@ -9,7 +9,8 @@ let existsCache: Record<string, boolean> = {};
|
|||||||
const IMPORT_RE = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
|
const IMPORT_RE = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
|
||||||
|
|
||||||
function matchImports(code: string): string[] {
|
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) {
|
function exists(filePath: string) {
|
||||||
|
Reference in New Issue
Block a user