MCPcopy
hub / github.com/vitejs/vite / addDeps

Function addDeps

packages/vite/src/node/ssr/ssrManifestPlugin.ts:83–94  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

81 // literal import - trace direct imports and add to deps
82 const analyzed: Set<string> = new Set<string>()
83 const addDeps = (filename: string) => {
84 if (filename === ownerFilename) return
85 if (analyzed.has(filename)) return
86 analyzed.add(filename)
87 const chunk = bundle[filename] as OutputChunk | undefined
88 if (chunk) {
89 chunk.viteMetadata!.importedCss.forEach((file) => {
90 deps.push(joinUrlSegments(base, file))
91 })
92 chunk.imports.forEach(addDeps)
93 }
94 }
95 const normalizedFile = normalizePath(
96 join(dirname(chunk.fileName), url.slice(1, -1)),
97 )

Callers 1

generateBundleFunction · 0.70

Calls 3

joinUrlSegmentsFunction · 0.90
hasMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected