forked from graphprotocol/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
48 lines (41 loc) · 1.07 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
import mdx from '@next/mdx'
import remarkFrontmatter from 'remark-frontmatter'
import remarkGfm from 'remark-gfm'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import { remarkMdxLayout } from './lib/remarkMdxLayout.mjs'
const env = {
BASE_PATH: process.env.NODE_ENV === 'production' ? '/docs' : '',
ALGOLIA_API_KEY: process.env.ALGOLIA_API_KEY,
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID,
}
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, remarkFrontmatter, [remarkMdxFrontmatter, { name: 'frontmatter' }], remarkMdxLayout],
providerImportSource: '@mdx-js/react',
jsxImportSource: 'theme-ui',
},
})
export default withMDX({
env,
pageExtensions: ['tsx', 'mdx'],
reactStrictMode: true,
basePath: env.BASE_PATH,
trailingSlash: true,
async redirects() {
return [
{
source: '/',
destination: '/en/',
permanent: false,
},
]
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
return config
},
})