-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.fatherrc.js
More file actions
78 lines (78 loc) · 1.87 KB
/
Copy path.fatherrc.js
File metadata and controls
78 lines (78 loc) · 1.87 KB
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
module.exports = {
esm: 'babel',
cjs: {
type: 'babel',
lazy: true,
},
umd: {
name: 'modernx',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
redux: 'Redux',
'react-redux': 'ReactRedux',
'redux-saga': 'createSagaMiddleware',
invariant: 'invariant',
'is-plain-object': 'isPlainObject',
warning: 'warning',
flatten: 'flatten'
},
},
lessInBabelMode: true,
cssModules: false,
extractCSS: false,
injectCSS: false,
runtimeHelpers: false,
// 简化 Babel 配置,避免冲突
extraBabelPlugins: [
['@babel/plugin-transform-runtime', {
corejs: false,
helpers: true,
regenerator: true,
}],
],
extraBabelPresets: [
['@babel/preset-env', {
modules: false,
targets: {
browsers: ['> 1%', 'last 2 versions'],
node: '14'
},
// 禁用所有可能冲突的插件
useBuiltIns: false,
corejs: false,
// 禁用类属性转换
include: [
'transform-arrow-functions',
'transform-block-scoped-functions',
'transform-template-literals',
'transform-literals',
'transform-function-name',
'transform-shorthand-properties',
'transform-computed-properties',
'transform-for-of',
'transform-sticky-regex',
'transform-unicode-escapes',
'transform-dotall-regex',
'transform-named-capturing-groups-regex',
'transform-unicode-regex',
'transform-async-to-generator',
'transform-regenerator',
'transform-exponentiation-operator',
'transform-object-rest-spread',
'transform-object-super'
]
}],
['@babel/preset-react', {
runtime: 'automatic'
}]
],
target: 'browser',
doc: {
themeConfig: {
name: 'modernx',
},
base: '/modernx',
publicPath: '/modernx/',
},
};