-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
44 lines (40 loc) · 1.09 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
import remarkFrontmatter from 'remark-frontmatter';
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';
import rehypeSlug from 'rehype-slug';
import createWithMdx from '@next/mdx';
import remarkGfm from 'remark-gfm';
import remarkMdxCodeMeta from 'remark-mdx-code-meta';
import { remarkNextStaticProps } from './plugins/remark-next-static-props.mjs';
const metaPropName = 'meta';
const withMDX = createWithMdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
[remarkFrontmatter],
[remarkMdxFrontmatter, { name: metaPropName }],
[remarkNextStaticProps, { name: metaPropName }],
[remarkMdxCodeMeta],
[remarkGfm],
],
rehypePlugins: [rehypeSlug],
providerImportSource: '@mdx-js/react',
},
});
export default withMDX({
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
};
return config;
},
experimental: {
scrollRestoration: true,
esmExternals: true,
},
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
});