-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathnext.config.mjs
63 lines (61 loc) · 1.61 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
import nextra from 'nextra'
import { getHighlighter, BUNDLED_LANGUAGES } from 'shiki'
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
latex: true,
flexsearch: { codeblocks: false },
defaultShowCopyCode: true,
mdxOptions: {
rehypePrettyCodeOptions: {
getHighlighter: options =>
getHighlighter({
...options,
langs: [
...BUNDLED_LANGUAGES,
{
id: 'zed',
scopeName: 'source.authzed',
aliases: ['zed', 'authzed'],
path: '../../../../../public/authzed.tmLanguage.json',
},
{
id: 'cel',
scopeName: 'source.cel',
aliases: ['cel'],
path: '../../../../../public/cel.tmLanguage.json',
},
{
id: 'textproto',
scopeName: 'source.textproto',
aliases: ['textproto'],
path: '../../../../../public/textproto.tmLanguage.json',
},
]
})
}
},
})
export default withNextra({
basePath: process.env.NEXT_PUBLIC_BASE_DIR ?? undefined,
assetPrefix:
process.env.VERCEL_ENV === 'production'
? 'https://docs-authzed.vercel.app/docs'
: undefined,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push(
...[
{
test: /\.yaml$/,
// type: 'json',
use: 'yaml-loader',
},
{
test: /\.svg$/,
use: '@svgr/webpack',
},
]
);
return config;
},
});