-
Notifications
You must be signed in to change notification settings - Fork 3
/
.dumirc.ts
59 lines (56 loc) · 1.37 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
import { defineConfig } from 'dumi';
import { readdirSync } from 'fs';
import { join } from 'path';
const PUBLIC_PATH = '/yunti/';
const isProduction = process.env.NODE_ENV === 'production';
const headPkgList: string[] = [];
const pkgDirList = readdirSync(join(__dirname, 'packages')).filter(
pkg => !pkg.includes('.') && !headPkgList.includes(pkg)
);
const pkgs = {
//
};
export const alias = pkgDirList.reduce((pre, name) => {
pre[`@yuntijs/${pkgs[name]}`] = join(__dirname, 'packages', name, 'src');
return {
...pre,
};
}, {});
export default defineConfig({
alias,
// autoAlias: true,
base: isProduction ? PUBLIC_PATH : '/',
resolve: {
docDirs: ['docs'],
atomDirs: [{ type: 'packages', dir: 'packages' }],
},
favicons: [`${PUBLIC_PATH}img/favicon.ico`],
publicPath: PUBLIC_PATH,
outputPath: `./dist${PUBLIC_PATH}`,
themeConfig: {
logo: `${PUBLIC_PATH}img/logo.svg`,
nav: [{ title: '开发指南', link: '/guide' }],
},
ignoreMomentLocale: true,
mfsu: {
strategy: 'normal',
shared: {
react: {
singleton: true,
},
},
},
// 默认重定向到子包的 src 文件夹
monorepoRedirect: {
peerDeps: true,
useRootProject: true,
},
lessLoader: {
javascriptEnabled: true,
strictMath: false,
math: 'parens-division',
modifyVars: {
// '@ant-prefix': PREFIX_CLS,
},
},
});