File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jsx2mp-loader" ,
3
- "version" : " 0.4.37-8 " ,
3
+ "version" : " 0.4.37-9 " ,
4
4
"description" : " " ,
5
5
"files" : [
6
6
" src"
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ function removeDeadCode(source) {
19
19
return transformSync ( source , {
20
20
parserOpts,
21
21
plugins : [
22
- 'babel-plugin-remove-unused-reference'
22
+ // 只传入插件名称时,云构建运行异常,babel 加载插件出错。所以必须增加 require()
23
+ // Error: Cannot find module 'babel-plugin-remove-unused-reference'
24
+ // Make sure that all the Babel plugins and presets you are using are defined as dependencies or devDependencies in your package.json file.
25
+ require ( 'babel-plugin-remove-unused-reference' )
23
26
]
24
27
} ) . code ;
25
28
}
@@ -29,7 +32,7 @@ function removeUnusedImport(source) {
29
32
parserOpts,
30
33
plugins : [
31
34
[
32
- 'babel-plugin-danger-remove-unused-imports' ,
35
+ require ( 'babel-plugin-danger-remove-unused-imports' ) ,
33
36
{
34
37
ignore : 'rax'
35
38
}
You can’t perform that action at this time.
0 commit comments