-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
59 lines (51 loc) · 1.66 KB
/
Copy pathnext.config.js
File metadata and controls
59 lines (51 loc) · 1.66 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
55
56
57
58
59
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import createMDX from "@next/mdx";
import "./src/env.js";
/** @type {import("next").NextConfig} */
const config = {
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
generateBuildId: async () => `build-${Date.now()}`,
// Exclude native modules from Server Components bundling
serverExternalPackages: ["isolated-vm"],
experimental: {
// Enable MDX-RS for better Turbopack support
mdxRs: true,
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-eval' 'unsafe-inline' https://authkit.workos.com https://*.workos.com",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: https:",
"font-src 'self' data:",
"connect-src 'self' https://api.workos.com https://*.workos.com https://api.nango.dev https://*.posthog.com https://eu.i.posthog.com",
"frame-src 'self' https://authkit.workos.com https://*.workos.com https://connect.nango.dev",
]
.join("; ")
.replace(/\s{2,}/g, " ")
.trim(),
},
],
},
];
},
};
// Create MDX configuration with Turbopack-compatible setup
// Both syntax highlighting and mermaid diagrams are handled client-side
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
},
});
export default withMDX(config);