Repository navigation
Expand file tree
/
Copy pathnext.config.ts
More file actions
38 lines (36 loc) · 1.55 KB
/
Copy pathnext.config.ts
File metadata and controls
38 lines (36 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import path from "path";
/** @type {import('next').NextConfig} */
const nextConfig = {
// A stray lockfile in the home directory otherwise makes Next guess the wrong workspace root.
outputFileTracingRoot: path.join(__dirname),
// The offer-letter route reads public/logo.png at runtime to embed it in the
// PDF; keep that file in the function bundle so it's there in production.
// (It degrades to a drawn monogram if the file is ever missing.)
outputFileTracingIncludes: {
"/api/admin/offer-letter": ["./public/logo.png"],
},
// Hosts that next/image may optimise. github.com/<user>.png redirects to
// avatars.githubusercontent.com, so both are needed.
images: {
remotePatterns: [
{ protocol: "https", hostname: "github.com" },
{ protocol: "https", hostname: "avatars.githubusercontent.com" },
{ protocol: "https", hostname: "images.unsplash.com" },
],
},
// Short, shareable link to the 10 PR Journey workbook.
async redirects() {
return [{ source: "/workbook", destination: "/learn/open-source", permanent: false }];
},
experimental: {
// Keep the client-side router cache for already-visited routes so going
// back to a page is instant instead of re-rendering on the server (and
// re-reading Firestore). 60s on dynamic pages balances snappy navigation
// against staleness on a data-backed app.
staleTimes: {
dynamic: 60,
static: 300,
},
},
};
export default nextConfig;