MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / collectDeps

Function collectDeps

packages/vite/hmr/server/websocket.ts:5191–5212  ·  view source on GitHub ↗
(pattern: RegExp)

Source from the content-addressed store, hash-verified

5189 // Collect dependencies from this file
5190 const deps = new Set<string>();
5191 const collectDeps = (pattern: RegExp) => {
5192 let match: RegExpExecArray | null;
5193 while ((match = pattern.exec(code)) !== null) {
5194 const spec = match[2];
5195 if (!spec || PAT.VUE_FILE_PATTERN.test(spec) || !shouldRemapImport(spec)) {
5196 continue;
5197 }
5198
5199 let key: string;
5200 if (spec.startsWith('/')) {
5201 key = spec;
5202 } else if (spec.startsWith('./') || spec.startsWith('../')) {
5203 key = path.posix.normalize(path.posix.join(importerDir, spec));
5204 if (!key.startsWith('/')) key = '/' + key;
5205 } else {
5206 continue;
5207 }
5208
5209 key = key.replace(PAT.QUERY_PATTERN, '');
5210 deps.add(key);
5211 }
5212 };
5213
5214 collectDeps(PAT.IMPORT_PATTERN_1);
5215 collectDeps(PAT.IMPORT_PATTERN_2);

Callers 3

processVueSfcFunction · 0.85
buildAndSendRegistryFunction · 0.85
handleHotUpdateFunction · 0.85

Calls 5

shouldRemapImportFunction · 0.85
joinMethod · 0.80
replaceMethod · 0.80
addMethod · 0.65
testMethod · 0.45

Tested by

no test coverage detected