Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 20fd52a

Browse files
committed
Fix the default-lambda filter by excluding the JSON files too
1 parent c0161b7 commit 20fd52a

File tree

3 files changed

+8
-2
lines changed
  • packages/lambda-at-edge
    • src
    • tests/fixtures
      • app-with-no-static-or-public-dir/.next/serverless/pages
      • simple-app/.next/serverless/pages

3 files changed

+8
-2
lines changed

packages/lambda-at-edge/src/build.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,14 @@ class Builder {
126126
{
127127
// skip api pages from default lambda code
128128
filter: file => {
129-
const isHTMLPage = path.extname(file) === ".html";
130-
return pathToPosix(file).indexOf("pages/api") === -1 && !isHTMLPage;
129+
const isHTML = path.extname(file) === ".html";
130+
const isJSON = path.extname(file) === ".json";
131+
132+
return (
133+
pathToPosix(file).indexOf("pages/api") === -1 &&
134+
!isHTML &&
135+
!isJSON
136+
);
131137
}
132138
}
133139
)

packages/lambda-at-edge/tests/fixtures/app-with-no-static-or-public-dir/.next/serverless/pages/blog.json

Whitespace-only changes.

packages/lambda-at-edge/tests/fixtures/simple-app/.next/serverless/pages/blog.json

Whitespace-only changes.

0 commit comments

Comments
 (0)