-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dumirc.ts
51 lines (45 loc) · 1.18 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
import { defineConfig } from 'dumi';
import { readdirSync } from 'fs';
import { join } from 'path';
import { chalk } from '@umijs/utils';
const isProd = process.env.NODE_ENV === 'production';
const prodConfig = isProd
? defineConfig({
ssr: {}
})
: defineConfig({});
const headPkgList: string[] = [];
const pkgList = readdirSync(join(__dirname, 'packages')).filter(
(pkg) => pkg.charAt(0) !== '.' && !headPkgList.includes(pkg)
);
const alias = pkgList.reduce<Record<string, string>>((pre, pkg) => {
pre[`@lotus-design/${pkg}`] = join(__dirname, 'packages', pkg, 'src');
return {
...pre
};
}, {});
console.log(`🌼 alias list \n${chalk.blue(Object.keys(alias).join('\n'))}`);
export default defineConfig({
hash: true,
outputPath: '_site',
themeConfig: {
logo: '/logo.png',
name: 'Lotus',
socialLinks: {
github: 'https://github.com/lotus-fe/react-components'
},
nav: [{ title: '组件', link: '/components' }]
},
alias,
favicons: ['/logo.png'],
resolve: {
docDirs: ['docs'],
atomDirs: pkgList.map((pkg) => {
return {
type: 'component',
dir: `packages/${pkg}/docs`
};
})
},
...prodConfig
});