-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dumirc.ts
125 lines (124 loc) · 2.87 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import { defineConfig } from 'dumi';
import { author, name, repository, version } from './package.json';
const isProduction = process.env.NODE_ENV === 'production';
const isWin = process.platform === 'win32';
const logo: string = 'https://www.h7ml.cn/logo.svg';
const themeConfig = {
name,
github: repository.url.split('.git')[0],
logo,
nav: [
{
title: '起步',
link: '/guide',
},
{
title: 'Hooks',
link: '/hooks',
},
{
title: 'Utils',
link: '/utils',
},
{
title: '更新日志',
link: '/changelog',
},
],
footer: false,
socialLinks: {
github: repository.url.split('.git')[0],
},
apiHeader: {
docUrl: `{github}/tree/master/src/{atomId}/index.md`,
match: ['/components'],
pkg: name,
sourceUrl: `{github}/tree/master/src/{atomId}/index.tsx`,
},
};
const config = {
styles: [
`html, body { background: transparent; }
@media (prefers-color-scheme: dark) {
html, body { background: #0E1116; }
}`,
],
codeSplitting: {
jsStrategy: 'granularChunks',
},
themeConfig,
resolve: {
// 设置横向导航栏
atomDirs: [
{ type: 'hooks', dir: 'src/hooks' },
{ type: 'utils', dir: 'src/utils' },
],
},
outputPath: 'docs-dist',
// apiParser: isProduction ? {} : false,
// resolve: isProduction
// ? {
// entryFile: './src/index.ts',
// }
// : undefined,
analyze: {
enable: true,
analyzerPort: 8888,
},
base: '/',
define: {
'process.env': process.env,
},
// demo: {
// lazyLoading: true,
// },
// showLineNum: true,
// nprogress: true,
// prefersColor: { default: 'auto', switch: true },
// editLink: true,
// lastUpdated: true,
// rtl: true,
mfsu: isWin ? undefined : {},
npmClient: 'pnpm',
publicPath: '/',
cacheDirectoryPath: './node_modules/.cache',
chainWebpack(
memo: {
plugin: (arg0: string) => {
(): any;
new (): any;
use: { (arg0: any, arg1: { banner: string }[]): void; new (): any };
};
},
{ env, webpack }: any,
) {
memo.plugin('copyright').use(webpack.BannerPlugin, [
{
banner: `Version: ${version} - © ${new Date().getFullYear()} ${author.name} <${
author.mail
}>. All rights reserved.`,
},
]);
},
clickToComponent: {
editor: 'vscode',
},
conventionLayout: true,
html2sketch: {},
analytics: {
// google analytics 的 key (GA 4)
ga_v2: 'G-QZLQV8KRND',
// 百度统计的 key
baidu: '7cd6e5c368ce90c5f557d5770d437d4a',
},
sitemap: { hostname: 'https://hooks.h7ml.cn' },
favicons: ['https://www.h7ml.cn/logo.svg'],
headScripts: [
{
src: '//sdk.51.la/js-sdk-pro.min.js?id=K9Jv3fShRp5JWNEa&ck=K9Jv3fShRp5JWNEa&autoTrack=true&hashMode=true',
charset: 'utf-8',
id: 'LA_COLLECT',
},
],
} as any;
export default defineConfig(config);