-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
39 lines (35 loc) · 1.08 KB
/
next.config.mjs
File metadata and controls
39 lines (35 loc) · 1.08 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
import createMDX from "@next/mdx";
import { createRequire } from "module";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";
const require = createRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
typescript: {
ignoreBuildErrors: true
},
images: {
unoptimized: true
},
basePath: "/learn"
};
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
// Strip frontmatter from rendered content
require.resolve("remark-frontmatter"),
// Enable GitHub Flavored Markdown (tables, strikethrough, etc.)
require.resolve("remark-gfm"),
// Expose frontmatter as props
require.resolve("remark-mdx-frontmatter"),
// Transform code blocks with title metadata into CodeBlock components
resolve(__dirname, "./lib/remark-code-title.mjs")
],
rehypePlugins: []
}
});
export default withMDX(nextConfig);