-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
54 lines (51 loc) · 2.02 KB
/
Copy pathnext.config.ts
File metadata and controls
54 lines (51 loc) · 2.02 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { NextConfig } from "next";
import createMDX from "@next/mdx";
const nextConfig: NextConfig = {
// Let .md/.mdx files be treated as pages/modules.
pageExtensions: ["ts", "tsx", "md", "mdx"],
// Pin the workspace root so Turbopack doesn't pick up a stray
// lockfile in a parent directory (e.g. ~/package-lock.json).
turbopack: {
root: __dirname,
},
// Keep the headless-Chromium packages out of the bundle so their native
// binary/brotli payloads resolve at runtime (resume PDF export).
serverExternalPackages: ["puppeteer-core", "@sparticuz/chromium"],
// @sparticuz/chromium ships its Chromium as brotli files under bin/*.br that
// nothing imports statically, so Next's file tracer leaves them out of the
// serverless bundle and chromium.executablePath() 500s with "The input
// directory .../bin does not exist". Force-include them for the PDF route.
// (Key is matched with picomatch, so avoid a literal "[id]" segment.)
outputFileTracingIncludes: {
"/api/resume/**": ["./node_modules/@sparticuz/chromium/bin/**"],
},
// Instagram media is served from the Meta CDN. We render it `unoptimized`
// (the signed URLs expire, so optimizing/caching them is pointless), but the
// host still has to be allow-listed here.
images: {
remotePatterns: [
{ protocol: "https", hostname: "**.cdninstagram.com" },
{ protocol: "https", hostname: "**.fbcdn.net" },
// Hero panel photo (Unsplash CDN).
{ protocol: "https", hostname: "images.unsplash.com" },
],
},
};
// Plugins are referenced by name (string) with serializable options, which is
// what Turbopack supports — it can't receive imported plugin functions.
const withMDX = createMDX({
options: {
remarkPlugins: ["remark-gfm", "remark-frontmatter"],
rehypePlugins: [
"rehype-slug",
[
"rehype-pretty-code",
{
theme: { light: "github-light", dark: "github-dark-dimmed" },
keepBackground: false,
},
],
],
},
});
export default withMDX(nextConfig);