MCPcopy
hub / github.com/vercel/next.js / readFilesNext

Function readFilesNext

test/production/deterministic-build/deployment-id.test.ts:27–56  ·  view source on GitHub ↗
(
  next: NextInstance
)

Source from the content-addressed store, hash-verified

25)
26
27async function readFilesNext(
28 next: NextInstance
29): Promise<Map<string, Map<string, string>>> {
30 // These are cosmetic files which aren't deployed.
31 const IGNORE = /^trace$|^trace-build$/
32
33 const files = (
34 (await glob('**/*', {
35 cwd: path.join(next.testDir, next.distDir),
36 nodir: true,
37 dot: true,
38 })) as string[]
39 )
40 .filter((f) => !IGNORE.test(f) && !IGNORE_CONTENT_NEXT_REGEX.test(f))
41 .sort()
42
43 return new Map([
44 [
45 'next',
46 new Map(
47 await Promise.all(
48 files.map(async (f) => {
49 const content = await next.readFile(path.join(next.distDir, f))
50 return [f, content] as const
51 })
52 )
53 ),
54 ],
55 ])
56}
57
58async function readFilesBuilder(
59 next: NextInstance

Callers

nothing calls this directly

Calls 8

allMethod · 0.80
testMethod · 0.65
globFunction · 0.50
sortMethod · 0.45
filterMethod · 0.45
joinMethod · 0.45
mapMethod · 0.45
readFileMethod · 0.45

Tested by

no test coverage detected