-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathrspress.config.ts
185 lines (183 loc) · 4.63 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import { pluginClientRedirects } from '@rspress/plugin-client-redirects';
import { pluginRss } from '@rspress/plugin-rss';
import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics';
import { pluginOpenGraph } from 'rsbuild-plugin-open-graph';
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
import pluginSitemap from 'rspress-plugin-sitemap';
import { defineConfig } from 'rspress/config';
import { rsbuildPluginOverview } from './theme/rsbuildPluginOverview';
const siteUrl = 'https://rsbuild.dev';
export default defineConfig({
plugins: [
pluginSitemap({
domain: siteUrl,
}),
pluginFontOpenSans(),
pluginRss({
siteUrl,
feed: [
{
id: 'releases-rss',
test: '/community/releases/v',
title: 'Rsbuild Releases',
language: 'en',
output: {
type: 'rss',
filename: 'releases-rss.xml',
},
},
{
id: 'releases-atom',
test: '/community/releases/v',
title: 'Rsbuild Releases',
language: 'en',
output: {
type: 'atom',
},
},
{
id: 'releases-rss-zh',
test: '/zh/community/releases/v',
title: 'Rsbuild Releases',
language: 'zh-CN',
output: {
type: 'rss',
filename: 'releases-rss-zh.xml',
},
},
{
id: 'releases-atom-zh',
test: '/zh/community/releases/v',
title: 'Rsbuild Releases',
language: 'zh-CN',
output: {
type: 'atom',
},
},
],
}),
pluginClientRedirects({
redirects: [
{
from: '/config/source/alias',
to: '/config/resolve/alias',
},
{
from: '/config/source/alias-strategy',
to: '/config/resolve/alias-strategy',
},
],
}),
],
lang: 'en',
title: 'Rsbuild',
icon: 'https://assets.rspack.dev/rsbuild/favicon-128x128.png',
logo: {
light: 'https://assets.rspack.dev/rsbuild/navbar-logo-light.png',
dark: 'https://assets.rspack.dev/rsbuild/navbar-logo-dark.png',
},
ssg: {
strict: true,
},
markdown: {
checkDeadLinks: true,
},
route: {
cleanUrls: true,
// exclude document fragments from routes
exclude: ['**/zh/shared/**', '**/en/shared/**', './theme', './src'],
},
themeConfig: {
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/web-infra-dev/rsbuild',
},
{
icon: 'x',
mode: 'link',
content: 'https://twitter.com/rspack_dev',
},
{
icon: 'discord',
mode: 'link',
content: 'https://discord.gg/XsaKEEk4mW',
},
],
locales: [
{
lang: 'en',
label: 'English',
description: 'The Rspack-based build tool for the web',
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rsbuild/tree/main/website/docs',
text: '📝 Edit this page on GitHub',
},
},
{
lang: 'zh',
label: '简体中文',
outlineTitle: '目录',
prevPageText: '上一页',
nextPageText: '下一页',
description: '由 Rspack 驱动的构建工具',
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rsbuild/tree/main/website/docs',
text: '📝 在 GitHub 上编辑此页',
},
},
],
},
builderConfig: {
dev: {
lazyCompilation: true,
},
plugins: [
rsbuildPluginOverview,
pluginGoogleAnalytics({ id: 'G-L6BZ6TKW4R' }),
pluginOpenGraph({
title: 'Rsbuild',
type: 'website',
url: siteUrl,
image:
'https://assets.rspack.dev/rsbuild/assets/rsbuild-og-image-v1-0.png',
description: 'The Rspack-based build tool',
twitter: {
site: '@rspack_dev',
card: 'summary_large_image',
},
}),
],
server: {
open: true,
},
html: {
tags: [
// for baidu SEO verification
{
tag: 'meta',
attrs: {
name: 'baidu-site-verification',
content: 'codeva-mYbzBtlg6o',
},
},
],
appIcon: {
name: 'Rsbuild',
icons: [
{
src: 'https://assets.rspack.dev/rsbuild/rsbuild-logo-192x192.png',
size: 192,
},
{
src: 'https://assets.rspack.dev/rsbuild/rsbuild-logo-512x512.png',
size: 512,
},
],
},
},
},
});