-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dumirc.ts
102 lines (99 loc) · 2.69 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
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
import { defineConfig } from 'dumi';
import type { SiteThemeConfig } from 'dumi-theme-antd-style';
import { footer } from 'ims-template-config';
import path from 'path';
import { featuresZh } from './config/features';
import style from './docs/siteIndexStyle';
import { homepage, name as repo } from './package.json';
const basePath = `/${repo}/`;
const isProd = process.env.NODE_ENV === 'production';
const themeConfig: SiteThemeConfig = {
name: repo,
github: homepage,
logo: isProd ? '/images/origin.png' : `/${repo}/images/origin.png`,
hero: {
'zh-CN': {
description: 'Ant Design Style 文档站主题包',
actions: [
{
type: 'primary',
text: '开始使用',
link: '/guide',
},
{
text: 'Github',
link: 'https://github.com/eternallycyf/',
openExternal: true,
},
],
features: featuresZh,
},
'en-US': {
description: 'dumi2 theme similar to antd v5 website',
actions: [
{
type: 'primary',
text: 'Start',
link: '/guide-en',
},
{
text: 'Config',
link: '/config-en',
},
],
},
},
socialLinks: { github: homepage },
apiHeader: {
sourceUrl: `https://github.com/eternallycyf/ims-template/tree/master/src/components/{atomId}/index.tsx`,
docUrl: `https://github.com/eternallycyf/ims-template/tree/master/src/components/{atomId}/index.md`,
pkg: 'ims-template',
match: ['/ims-template/src/component'],
},
footerConfig: {
bottom: '2023',
copyright: 'Made with ❤️ by eternallycyf - AFX & 数字科技',
columns: footer(repo),
},
};
export default defineConfig({
define: {
'process.env': process.env,
},
base: isProd ? '/' : `/${repo}`,
publicPath: isProd ? '/' : basePath,
alias: {
[repo]: path.join(__dirname, './src'),
[repo + '/src']: path.join(__dirname, './src/*'),
},
favicons: [isProd ? '/images/favicon.ico' : `/${repo}/images/favicon.ico`],
styles: [
`html, body { background: transparent; }
@media (prefers-color-scheme: dark) {
html, body { background: #0E1116; }
}`,
style,
],
outputPath: 'docs-dist',
devtool: isProd ? false : 'source-map',
clickToComponent: {},
ignoreMomentLocale: true,
targets: { chrome: 79 },
codeSplitting: { jsStrategy: 'granularChunks' },
themeConfig,
ssr: false,
extraBabelPlugins: ['antd-style'],
hash: true,
mock: {},
exportStatic: false,
html2sketch: {},
mfsu: {
runtimePublicPath: true,
},
resolve: {
docDirs: ['docs'],
atomDirs: [{ type: 'component', dir: './src/components' }],
entryFile: './src/index.ts',
codeBlockMode: 'passive',
},
});