-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathrspress.config.ts
106 lines (105 loc) · 2.76 KB
/
rspress.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import path from 'node:path';
import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics';
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
import { defineConfig } from 'rspress/config';
export default defineConfig({
plugins: [pluginFontOpenSans()],
root: path.join(__dirname, 'docs'),
lang: 'en',
base: '/',
title: 'Rslib',
icon: 'https://assets.rspack.dev/rslib/rslib-logo-192x192.png',
logo: 'https://assets.rspack.dev/rslib/rslib-logo-192x192.png',
logoText: 'Rslib',
ssg: {
strict: true,
},
markdown: {
checkDeadLinks: true,
},
search: {
codeBlocks: true,
},
route: {
cleanUrls: true,
// exclude document fragments from routes
exclude: ['**/zh/shared/**', '**/en/shared/**', './theme'],
},
themeConfig: {
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/web-infra-dev/rslib',
},
{
icon: 'x',
mode: 'link',
content: 'https://twitter.com/rspack_dev',
},
{
icon: 'discord',
mode: 'link',
content: 'https://discord.gg/XsaKEEk4mW',
},
],
locales: [
{
lang: 'en',
label: 'English',
title: 'Rslib',
description: 'The Rsbuild-based library development tool',
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
text: '📝 Edit this page on GitHub',
},
},
{
lang: 'zh',
label: '简体中文',
title: 'Rslib',
outlineTitle: '目录',
prevPageText: '上一页',
nextPageText: '下一页',
searchPlaceholderText: '搜索文档',
searchNoResultsText: '无法找到相关搜索结果',
searchSuggestedQueryText: '请使用不同的关键字重试',
description: '基于 Rsbuild 的库构建工具',
overview: {
filterNameText: '过滤',
filterPlaceholderText: '输入关键词',
filterNoResultText: '未找到匹配的 API',
},
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
text: '📝 在 GitHub 上编辑此页',
},
},
],
},
builderConfig: {
dev: {
lazyCompilation: true,
},
tools: {
rspack: {
cache: true,
experiments: {
cache: {
type: 'persistent',
},
},
},
},
source: {
alias: {
'@components': path.join(__dirname, '@components'),
'@en': path.join(__dirname, 'docs/en'),
'@zh': path.join(__dirname, 'docs/zh'),
},
},
plugins: [pluginGoogleAnalytics({ id: 'G-Q66CEHQ6JR' })],
},
});