-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.umirc.ts
81 lines (79 loc) · 2.24 KB
/
.umirc.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
import { defineConfig } from 'dumi';
process.env.REMAX_PLATFORM = 'web';
export default defineConfig({
title: 'Kqinfo UI',
favicon: 'https://z3.ax1x.com/2021/04/12/cBYdw8.png',
logo: 'https://z3.ax1x.com/2021/04/12/cBYdw8.png',
outputPath: 'docs-dist',
mode: 'site',
theme: {
'@c-primary': '#2780da',
},
themeConfig: {
carrier: 'KQ UI', // 设备状态栏左侧的文本内容
hd: {
// umi-hd 的 750 高清方案(默认值)
// [{ mode: 'vw', options: [100, 750] }],
// 根据不同的设备屏幕宽度断点切换高清方案
rules: [
{ maxWidth: 375, mode: 'vw', options: [100, 750] },
{ minWidth: 376, maxWidth: 750, mode: 'vw', options: [100, 1500] },
],
// 更多 rule 配置访问 https://github.com/umijs/dumi/blob/master/packages/theme-mobile/src/typings/config.d.ts#L7
},
},
alias: {
'react-native': 'react-native-web',
},
base: '/ui/',
publicPath: '/ui/',
navs: [null, { title: 'GitHub', path: 'https://github.com/cqkqinfo/ui' }, { title: 'RN模版', path: 'https://github.com/cqkqinfo/remax-react-native-template.git' }],
extraBabelPlugins: [
[
'babel-plugin-import',
{
libraryName: 'antd-mobile',
libraryDirectory: 'es/components',
style: false,
},
'antd-mobile',
],
[
'babel-plugin-import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
'antd',
],
[
'babel-plugin-import',
{
libraryName: 'parsec-hooks',
camel2DashComponentName: false,
customName: (name: string) => {
if (name === 'ContainerUseWrap') {
return `parsec-hooks/lib/${name}`;
}
if (/^(use)/.test(name)) {
return `parsec-hooks/lib/${name
.replace(/^(use)/, '')
.replace(/^\S/, s => s.toLowerCase())}Hooks`;
} else {
return `parsec-hooks/lib/utils/${name}`;
}
},
},
'parsec-hooks',
],
],
extraPostCSSPlugins: [
require('postcss-unit-transforms')({
multiple: (fileName: string) => {
return /(.dumi)|(antd)/.test(fileName) ? 1 : 0.5;
},
targetUnits: 'px',
}),
],
});