Skip to content

Commit

Permalink
feat(transformer): 没有用到的 import 删除掉引用
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jun 14, 2018
1 parent 8ddcf99 commit 78d1c71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/taro-cli/package.json
Expand Up @@ -29,6 +29,7 @@
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babel-types": "^6.26.0",
"babel-plugin-danger-remove-unused-import": "^1.0.13",
"babylon": "^6.18.0",
"chalk": "^2.3.2",
"chokidar": "^2.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/taro-transformer-wx/package.json
Expand Up @@ -47,6 +47,7 @@
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.47",
"@babel/plugin-transform-typescript": "^7.0.0-beta.47",
"babel-core": "^6.26.3",
"babel-plugin-danger-remove-unused-import": "^1.0.13",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-traverse": "^6.26.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-transformer-wx/src/index.ts
Expand Up @@ -72,7 +72,8 @@ export default function transform<T> (options: Options): TransformResult {
'objectRestSpread',
'decorators'
] as any[]
}
},
plugins: ['danger-remove-unused-import', { ignore: ['Taro'] }]
}).ast as t.File
// transformFromAst(ast, code)
let result
Expand Down

0 comments on commit 78d1c71

Please sign in to comment.