32451e979e
This brings us one step closer to outputting serverless functions as renderToHTML now renders the passed components, which allows us to bundle the renderToHTML function together with statically imported components in webpack.
20 lines
476 B
TypeScript
20 lines
476 B
TypeScript
import {normalizePagePath} from './require'
|
|
|
|
export type BuildManifest = {
|
|
devFiles: string[],
|
|
pages: {
|
|
[page: string]: string[]
|
|
}
|
|
}
|
|
|
|
export function getPageFiles (buildManifest: BuildManifest, page: string): string[] {
|
|
const normalizedPage = normalizePagePath(page)
|
|
const files = buildManifest.pages[normalizedPage]
|
|
|
|
if (!files) {
|
|
console.warn(`Could not find files for ${normalizedPage} in .next/build-manifest.json`)
|
|
return []
|
|
}
|
|
|
|
return files
|
|
}
|