-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrspress.config.ts
54 lines (50 loc) · 1.36 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
import path from 'node:path'
import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics'
import { defineConfig } from 'rspress/config'
import { locale } from './locale'
import type { RspressPlugin } from '@rspress/shared'
const base = '/reactive/'
const plugins: RspressPlugin[] = []
const builderPlugins: ReturnType<typeof pluginGoogleAnalytics>[] = []
if (process.env.IS_SODOC) {
plugins.push(require('@shein/rspress-plugin-sodoc')())
} else {
builderPlugins.push(pluginGoogleAnalytics({ id: 'G-R8D51L3PN0' }))
}
export default defineConfig({
root: path.resolve(__dirname, './docs'),
base,
lang: 'en',
title: 'Reactive',
description: locale.en.description,
outDir: 'docs-dist',
plugins,
themeConfig: {
// enableContentAnimation: true,
enableScrollToTop: true,
darkMode: !process.env.IS_SODOC,
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/sheinsight/reactive',
},
],
locales: [locale.en, locale.zhCN],
},
builderPlugins,
builderConfig: {
html: {
tags: process.env.IS_SODOC ? [{ tag: 'script', children: "window.RSPRESS_THEME = 'light';" }] : [],
},
output: {
cleanDistPath: true,
},
source: {
alias: {
'@@': path.resolve(__dirname, './'),
'@': path.resolve(__dirname, './src'),
},
},
},
})