-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrsbuild.config.ts
43 lines (41 loc) · 956 Bytes
/
rsbuild.config.ts
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 path from "path";
import { defineConfig } from "@rsbuild/core";
import { pluginMdx } from "@rsbuild/plugin-mdx";
import { pluginReact } from "@rsbuild/plugin-react";
import { recmaCodeHike, remarkCodeHike } from "codehike/mdx";
import rehypeSlug from "rehype-slug";
import rehypeToc from "@jsdevtools/rehype-toc";
const chConfig = {
components: { code: "CodeHike" },
};
export default defineConfig({
html: {
favicon: path.join(__dirname, "public/logo.svg"),
template: path.join(__dirname, "index.html"),
},
source: {
alias: {
"@/": path.join(__dirname, "src"),
},
},
output: {
distPath: {
root: "dist",
},
},
server: {
port: 8888,
},
plugins: [
pluginMdx({
mdxLoaderOptions: {
remarkPlugins: [[remarkCodeHike, chConfig]],
rehypePlugins: [rehypeSlug, rehypeToc],
recmaPlugins: [[recmaCodeHike, chConfig]],
jsx: true,
providerImportSource: "@mdx-js/react",
},
}),
pluginReact(),
],
});