-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.ts
76 lines (74 loc) · 2 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
import { defineConfig } from 'dumi'
import path from 'path'
import { version } from './packages/mobile/package.json'
export default defineConfig({
title: 'Fexd Mobile',
favicon: './logo.png',
logo: process.env.NODE_ENV === 'production' ? '/mobile/logo.png' : '/logo.png',
outputPath: 'docs',
publicPath: process.env.NODE_ENV === 'production' ? '/mobile/' : '/',
mode: 'site',
locales: [['zh-CN', '中文']],
history: { type: 'hash' },
resolve: {
includes: ['documents', 'packages/mobile/src', 'packages/mobile-router5/src'],
},
themeConfig: {
hd: {
rules: [],
},
},
sass: {},
navs: [
null,
{
title: 'GitHub',
path: 'https://github.com/fexd-team/mobile',
},
{ title: `v${version}`, path: 'https://www.npmjs.com/package/@fexd/mobile' },
],
alias: {
'@root': process.cwd(),
'@documents': path.resolve(__dirname, './documents'),
'@dumiTheme': path.resolve(__dirname, './.dumi/theme'),
},
nodeModulesTransform: {
type: 'none',
},
extraBabelPlugins: [
[
'babel-plugin-jsx-css-modules',
{
styleFileReg: [/\.module\.(css|less|scss)$/],
prefer: 'local',
helperImportType: 'esm',
},
],
[
'babel-plugin-import',
{
libraryName: '@fexd/tools',
camel2DashComponentName: false,
libraryDirectory: 'es',
},
'@fexd/tools',
],
...(process.env.NODE_ENV === 'development'
? []
: [
[
'babel-plugin-import',
{
libraryName: '@fexd/mobile',
libraryDirectory: 'src/exports',
camel2DashComponentName: false,
style: false // () => '@root/packages/mobile/src/style.less',
},
'@fexd/mobile',
],
]),
],
// 使用 mfsu 配置来进行加速,具体参考以下地址
// https://github.com/umijs/umi/issues/6766
// mfsu: {}, // 感觉没啥明显的效果,还会引发一些奇怪的样式问题,先关了
})