Skip to content

Commit

Permalink
fix(lambda-at-edge): handle prerender-manifest v3 locales properly (#910
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dphang committed Mar 2, 2021
1 parent ab68a3e commit 5200d74
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/libs/lambda-at-edge/src/build.ts
Expand Up @@ -920,7 +920,16 @@ class Builder {

// Copy locale-specific prerendered files if defined, otherwise use empty locale
// which would copy to root only
const locales = routesManifest.i18n?.locales ?? [""];
let locales;

// @ts-ignore
if (prerenderManifest.version > 2) {
// In newer Next.js 10 versions with prerender manifest version 3, it has one entry for each locale: https://github.com/vercel/next.js/pull/21404
// So we don't need to iterate through each locale and prefix manually
locales = [""];
} else {
locales = routesManifest.i18n?.locales ?? [""];
}

for (const locale of locales) {
prerenderManifestJSONPropFileAssets.concat(
Expand Down

0 comments on commit 5200d74

Please sign in to comment.