Download next.js/packages/next/src/server/get-page-files.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/get-page-files.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/server/get-page-files.ts
-
curl -L -o get-page-files.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/get-page-files.ts
1.12 kB
| import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path' | |
| import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path' | |
| export type BuildManifest = { | |
| devFiles: readonly string[] | |
| ampDevFiles: readonly string[] | |
| polyfillFiles: readonly string[] | |
| lowPriorityFiles: readonly string[] | |
| rootMainFiles: readonly string[] | |
| // this is a separate field for flying shuttle to allow | |
| // different root main files per entries/build (ideally temporary) | |
| // until we can stitch the runtime chunks together safely | |
| rootMainFilesTree: { [appRoute: string]: readonly string[] } | |
| pages: { | |
| '/_app': readonly string[] | |
| [page: string]: readonly string[] | |
| } | |
| ampFirstPages: readonly string[] | |
| } | |
| export function getPageFiles( | |
| buildManifest: BuildManifest, | |
| page: string | |
| ): readonly string[] { | |
| const normalizedPage = denormalizePagePath(normalizePagePath(page)) | |
| let files = buildManifest.pages[normalizedPage] | |
| if (!files) { | |
| console.warn( | |
| `Could not find files for ${normalizedPage} in .next/build-manifest.json` | |
| ) | |
| return [] | |
| } | |
| return files | |
| } | |