-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsource.config.ts
More file actions
43 lines (40 loc) · 1.42 KB
/
source.config.ts
File metadata and controls
43 lines (40 loc) · 1.42 KB
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
import { defineDocs, defineConfig } from "fumadocs-mdx/config";
import remarkTabsSyntax from "./plugins/remark-tabs-syntax";
import remarkCodeGroupToTabs from "./plugins/remark-codegroup-to-tabs";
import remarkCodeLanguage from "./plugins/remark-code-language";
import remarkImagePaths from "./plugins/remark-image-paths";
import remarkLinkPaths from "./plugins/remark-link-paths";
import remarkFollowExport from "./plugins/remark-follow-export";
import remarkDirective from "remark-directive";
import { remarkInclude } from "fumadocs-mdx/config";
import remarkSdkFilter from "./plugins/remark-sdk-filter";
const isDevelopment = process.env.NODE_ENV === "development";
export const docs = defineDocs({
dir: "content/docs",
docs: {
async: isDevelopment,
postprocess: {
includeProcessedMarkdown: true,
},
},
});
export default defineConfig({
mdxOptions: {
// Shiki highlighting is one of the most expensive parts of the MDX pipeline.
// Keep it in builds, but skip it in local dev so first-page SSR doesn't have
// to highlight hundreds of code-heavy docs up front.
rehypeCodeOptions: isDevelopment ? false : undefined,
remarkPlugins: (existing) => [
remarkImagePaths,
remarkLinkPaths,
remarkFollowExport,
...existing,
remarkInclude,
remarkDirective,
remarkTabsSyntax,
remarkCodeLanguage,
remarkCodeGroupToTabs,
remarkSdkFilter,
],
},
});