MCPcopy Create free account
hub / github.com/TanStack/router / collectInitialJsFiles

Function collectInitialJsFiles

scripts/benchmarks/bundle-size/measure.mjs:260–291  ·  view source on GitHub ↗
(manifest, entryKey)

Source from the content-addressed store, hash-verified

258}
259
260function collectInitialJsFiles(manifest, entryKey) {
261 const visitedKeys = new Set()
262 const files = new Set()
263
264 function visitByKey(chunkKey) {
265 if (!chunkKey || visitedKeys.has(chunkKey)) {
266 return
267 }
268
269 visitedKeys.add(chunkKey)
270 const chunk = manifest[chunkKey]
271
272 if (!chunk) {
273 return
274 }
275
276 if (typeof chunk.file === 'string' && isJsFile(chunk.file)) {
277 files.add(chunk.file)
278 }
279
280 for (const imported of chunk.imports || []) {
281 const resolvedKey = resolveManifestChunkKey(manifest, imported)
282 if (resolvedKey) {
283 visitByKey(resolvedKey)
284 }
285 }
286 }
287
288 visitByKey(entryKey)
289
290 return [...files].sort()
291}
292
293function collectAllViteJsFiles(manifest) {
294 const files = new Set()

Callers 1

resolveBundleFilesFunction · 0.85

Calls 1

visitByKeyFunction · 0.85

Tested by

no test coverage detected