This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.babelrc
48 lines (48 loc) · 1.87 KB
/
.babelrc
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
{
"plugins": [
[
"imports",
{
// "ruleExtend": "ruleExtend.js", // 规则扩展文件路径,相对于 process.cwd()
"rules": [
{
"ignoreCheckNewModuleName": false, // 忽略检查新模块名称 !!警告:规则配置不当可能会造成死循环!!
"moduleName": "^moduleName$", // 模块名称
"importType": {
"importSpecifier": { // 原导入类型(小驼峰) <importSpecifier|importDefaultSpecifier|importNamespaceSpecifier>
"transforms": [
{
"newImportType": "ImportDefaultSpecifier", // 新导入类型(大驼峰) <ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier>
"newModuleName": "[moduleName]/path/[importedName]", // 新模块名称
"newImportedName": "[importedName]", // 新导入名称
"newLocalName": "[localName]" // 新本地名称
}
]
},
"importDefaultSpecifier": {
"transforms": [
{
"newImportType": "ImportSpecifier",
"newModuleName": "[moduleName]/path/[importedName]",
"newImportedName": "default",
"newLocalName": "[localName]"
}
]
},
"importNamespaceSpecifier": {
"transforms": [
{
"newImportType": "ImportDefaultSpecifier",
"newModuleName": "[moduleName]/path/[importedName]",
"newImportedName": "[importedName]",
"newLocalName": "[localName]"
}
]
}
}
}
]
}
]
]
}