-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
79 lines (74 loc) · 1.67 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import remarkGfm from "remark-gfm";
import createMDX from "@next/mdx";
/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
redirects: async () => {
return [
{
source: "/docs/guides",
destination: "/docs",
permanent: true,
},
{
source: "/docs/reference",
destination: "/docs",
permanent: true,
},
{
source: "/docs/reference/elements",
destination: "/docs#elements",
permanent: true,
},
{
source: "/docs/reference/events",
destination: "/docs#events",
permanent: true,
},
];
},
webpack: (config, options) => {
config.module.rules.push(
{
test: /\.xsd/,
use: [
{
loader: "raw-loader",
},
],
},
{
test: /\.mml/,
use: [
{
loader: "raw-loader",
},
],
},
{
test: /\.(glb|hdr)/,
type: "asset/resource",
},
);
// stub the fs module
config.resolve.fallback = {
fs: false,
};
return config;
},
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
};
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
// as the package is ESM only
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [remarkGfm],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
providerImportSource: "@mdx-js/react",
},
});
// Merge MDX config with Next.js config
export default withMDX(nextConfig);