-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
38 lines (33 loc) · 1 KB
/
next.config.mjs
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 createMDX from '@next/mdx'
import remarkTOC from 'remark-toc'
import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import remarkGfm from 'remark-gfm'
import { getBuildInfo } from './scripts/getBuildInfo.mjs'
const buildInfo = getBuildInfo()
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
transpilePackages: ['next-mdx-remote'],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || undefined,
output: 'export',
env: { ...buildInfo },
}
const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [
[remarkTOC, { heading: '(table[ -]of[ -])?contents?|toc|mục lục' }],
remarkGfm,
],
rehypePlugins: [rehypeSlug, rehypeAutolinkHeadings],
remarkRehypeOptions: {
clobberPrefix: 'footnote-',
footnoteLabel: 'Chú thích',
},
},
})
// Merge MDX config with Next.js config
export default withMDX(nextConfig)