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

Function mapFiles

packages/vite/src/node/server/warmup.ts:73–100  ·  view source on GitHub ↗
(files: string[], root: string)

Source from the content-addressed store, hash-verified

71}
72
73async function mapFiles(files: string[], root: string) {
74 if (!files.length) return []
75
76 const result: string[] = []
77 const globs: string[] = []
78 for (const file of files) {
79 if (isDynamicPattern(file)) {
80 globs.push(file)
81 } else {
82 if (path.isAbsolute(file)) {
83 result.push(file)
84 } else {
85 result.push(path.resolve(root, file))
86 }
87 }
88 }
89 if (globs.length) {
90 result.push(
91 ...(await glob(globs, {
92 absolute: true,
93 cwd: root,
94 expandDirectories: false,
95 ignore: ['**/.git/**', '**/node_modules/**'],
96 })),
97 )
98 }
99 return result
100}

Callers 1

warmupFilesFunction · 0.85

Calls 2

globFunction · 0.85
resolveMethod · 0.65

Tested by

no test coverage detected