-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnext.config.ts
More file actions
44 lines (39 loc) · 1.19 KB
/
next.config.ts
File metadata and controls
44 lines (39 loc) · 1.19 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
import createMDX from "@next/mdx"
import * as v1 from "codehike/mdx"
import { remarkCodeHike } from "codehike/mdx"
import remarkGfm from "remark-gfm"
/** @type {import('codehike/mdx').CodeHikeConfig} */
const chConfig = {
syntaxHighlighting: { theme: "github-light" },
}
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ""
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export" as const, // Enable static HTML export
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
images: {
unoptimized: true, // Required for static export
},
// Apply basePath and assetPrefix when NEXT_PUBLIC_BASE_PATH is set
...(basePath && {
basePath,
assetPrefix: basePath,
}),
}
const withMDX = createMDX({
options: {
remarkPlugins: [
remarkGfm,
[v1.remarkCodeHike, chConfig],
[remarkCodeHike, { theme: "github-light", lineNumbers: false }],
],
recmaPlugins: [[v1.recmaCodeHike, chConfig]],
},
})
// Merge MDX config with Next.js config
export default withMDX(nextConfig)