Skip to content

Commit 2cc81ca

Browse files
committed
Set NextJS build to serverless
We must build our NextJS app as a serverless app. When we build, this creates a standalone .js function for each page. Our NextRouter Netlify function can then trigger that function when a user requests a certain page.
1 parent 264fd08 commit 2cc81ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

next.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
// Target must be serverless
3+
target: 'serverless',
4+
// distDir already has .next as default
5+
distDir: '.next',
6+
};

0 commit comments

Comments
 (0)