Skip to content

Commit

Permalink
Ensure notFound entries are not added to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jan 27, 2021
1 parent 73a9f24 commit f528d9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
21 changes: 12 additions & 9 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1164,15 +1164,18 @@ export default async function build(
// TODO: do we want to show all locale variants in build output
for (const locale of i18n.locales) {
const localePage = `/${locale}${page === '/' ? '' : page}`
finalPrerenderRoutes[localePage] = {
initialRevalidateSeconds:
exportConfig.initialPageRevalidationMap[localePage],
srcRoute: null,
dataRoute: path.posix.join(
'/_next/data',
buildId,
`${file}.json`
),

if (!ssgNotFoundPaths.includes(localePage)) {
finalPrerenderRoutes[localePage] = {
initialRevalidateSeconds:
exportConfig.initialPageRevalidationMap[localePage],
srcRoute: null,
dataRoute: path.posix.join(
'/_next/data',
buildId,
`${file}.json`
),
}
}
}
} else {
Expand Down
8 changes: 0 additions & 8 deletions test/integration/i18n-support/test/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@ export function runTests(ctx) {
\\"srcRoute\\": \\"/gsp/fallback/[slug]\\",
\\"dataRoute\\": \\"/_next/data/BUILD_ID/en/gsp/fallback/always.json\\"
},
\\"/en/not-found\\": {
\\"srcRoute\\": null,
\\"dataRoute\\": \\"/_next/data/BUILD_ID/not-found.json\\"
},
\\"/fr\\": {
\\"initialRevalidateSeconds\\": false,
\\"srcRoute\\": null,
Expand Down Expand Up @@ -768,10 +764,6 @@ export function runTests(ctx) {
\\"initialRevalidateSeconds\\": false,
\\"srcRoute\\": \\"/gsp/fallback/[slug]\\",
\\"dataRoute\\": \\"/_next/data/BUILD_ID/nl/gsp/fallback/always.json\\"
},
\\"/nl/not-found\\": {
\\"srcRoute\\": null,
\\"dataRoute\\": \\"/_next/data/BUILD_ID/not-found.json\\"
}
}"
`)
Expand Down

0 comments on commit f528d9d

Please sign in to comment.