-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.dumirc.ts
63 lines (59 loc) · 1.46 KB
/
.dumirc.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
import { defineConfig } from 'dumi';
import pkg from './package.json';
const { BUIDL_DOC_VERSION, NODE_ENV } = process.env;
const MajorVersionNumber = pkg.version.split('.')[0];
const versionSiteRoot = `refs/heads/v${MajorVersionNumber}`;
const version = BUIDL_DOC_VERSION ? versionSiteRoot : 'latest';
const isDev = NODE_ENV === 'development';
const serverRootDirect = isDev ? '/' : `/${pkg.name}/`;
const publicPath = isDev ? '/' : serverRootDirect + version + '/';
const outputPath = 'dist';
export default defineConfig({
themeConfig: {
name: 'cra-template-doly',
logo: 'https://doly-dev.github.io/logo.png',
nav: {
'zh-CN': [
{
title: '文档',
link: '/docs'
},
{
title: 'GitHub',
link: 'https://github.com/doly-dev/cra-template-doly'
}
],
'en-US': [
{
title: 'Documents',
link: '/docs'
},
{
title: 'GitHub',
link: 'https://github.com/doly-dev/cra-template-doly'
}
]
}
},
favicons: ['https://doly-dev.github.io/favicon.png'],
history: {
type: 'hash'
},
hash: true,
publicPath,
outputPath,
locales: [
{ id: 'zh-CN', name: '中文' },
{ id: 'en-US', name: 'English' }
],
analytics: {
ga_v2: 'G-CTKFHCWM1R'
},
styles: [
`body .dumi-default-header-left {
width: auto;
margin-right: 24px;
}`
]
// more config: https://d.umijs.org/config
});