-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.js
113 lines (106 loc) · 2.58 KB
/
.umirc.js
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
import { defineConfig } from 'dumi';
import { readdirSync } from 'fs';
import chalk from 'chalk';
import { join } from 'path';
const webpack = require('webpack');
const headPkgList = [];
const pkgList = readdirSync(join(__dirname, 'packages')).filter(
(pkg) => pkg.charAt(0) !== '.' && !headPkgList.includes(pkg),
);
const alias = pkgList.reduce((pre, pkg) => {
pre[`@tddc/${pkg}`] = join(__dirname, 'packages', pkg, 'src');
return {
...pre,
};
}, {});
console.log(`🌼 alias list \n${chalk.blue(Object.keys(alias).join('\n'))}`);
const tailPkgList = pkgList
.map((path) => [join('packages', path, 'src'), join('packages', path, 'src', 'components')])
.reduce((acc, val) => acc.concat(val), []);
export default defineConfig({
title: 'tddc',
favicon: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
logo: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
outputPath: 'lerna-resource',
publicPath: process.env.NODE_ENV === 'production' ? '/tddc/' : '/',
base:process.env.NODE_ENV === 'production' ? '/tddc/' : '/',
mode: 'site',
extraBabelPlugins: [
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
],
],
resolve: {
includes: [...tailPkgList, 'docs'],
},
alias: alias,
proxy:{
'/bridgeApi': {
target: 'https://tiangong.tcloud.tongdun.cn/',
changeOrigin: true,
pathRewrite: {}
},
},
chainWebpack(memo){
memo.plugin('ProvidePlugin').use(webpack.ProvidePlugin,[{
React: 'react'
}]);
memo.plugin('DefinePlugin').use(webpack.DefinePlugin,[{
'process.env': JSON.stringify(process.env)
}]);
},
dynamicImport:{},
metas: [
{
property: 'og:description',
content: '🏆 让中后台开发更简单',
}
],
locales: [
['zh-CN', '中文'],
['en-US', 'English'],
],
navs: {
'en-US': [
null,
{
title: 'GitHub',
path: 'https://github.com/TDFE/tddc',
},
],
'zh-CN': [
null,
{
title: 'GitHub',
path: 'https://github.com/TDFE/tddc',
},
],
},
menus: {
'/components': [
{
title: '架构设计',
children: ['components.md'],
},
{
title: '通用',
children: pkgList,
},
],
'/en-US/components': [
{
title: 'Architecture Design',
children: ['components.en-US.md'],
},
{
title: 'General',
children: pkgList,
},
]
}
});