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

Function addFileDep

packages/vite/src/node/plugins/importAnalysisBuild.ts:359–369  ·  view source on GitHub ↗
(
            url: string,
            runtime: boolean = false,
          )

Source from the content-addressed store, hash-verified

357
358 const fileDeps: FileDep[] = []
359 const addFileDep = (
360 url: string,
361 runtime: boolean = false,
362 ): number => {
363 const index = fileDeps.findIndex((dep) => dep.url === url)
364 if (index === -1) {
365 return fileDeps.push({ url, runtime }) - 1
366 } else {
367 return index
368 }
369 }
370
371 if (imports.length) {
372 for (let index = 0; index < imports.length; index++) {

Callers 1

generateBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected