-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
41 lines (37 loc) · 1.05 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
import createMDXPlugin from "@next/mdx"
import { rehypePlugins, remarkPlugins } from "@renoun/mdx"
import rehypeMdxImportMedia from "rehype-mdx-import-media"
const withMDX = createMDXPlugin({
options: {
remarkPlugins,
rehypePlugins: [...rehypePlugins, rehypeMdxImportMedia],
},
})
export default withMDX({
output: "export",
reactStrictMode: true,
trailingSlash: true,
poweredByHeader: false,
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },
images: { unoptimized: true },
webpack(config, { webpack }) {
config.resolve.extensionAlias = {
".js": [".ts", ".tsx", ".js"],
}
/* Silence critical dependency warnings for @ts-morph/common */
config.plugins.push(
new webpack.ContextReplacementPlugin(
/\/(@ts-morph\/common)\//,
(data) => {
for (const dependency of data.dependencies) {
delete dependency.critical
}
return data
},
),
)
return config
},
})