e5111745b5
* Add WithAmp to enable AMP support for pages instead of .amp.js * Update handling for exporting AMP * Fix ampPath in export for / path and revert isAmp logic to handle right * Update amphtml test suite * Add handling for noDirtyAmp during export and update amp-export test suite * Update serverless and export-default-map test suites * Update require-page tests
21 lines
523 B
TypeScript
21 lines
523 B
TypeScript
import { normalizePagePath } from './normalize-page-path'
|
|
|
|
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) {
|
|
// tslint:disable-next-line
|
|
console.warn(`Could not find files for ${normalizedPage} in .next/build-manifest.json`)
|
|
return []
|
|
}
|
|
|
|
return files
|
|
}
|