Skip to content

Commit

Permalink
fix(transformer-wx): 修复tsx文件中读取不到config的问题,fix #2592
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly committed Mar 27, 2019
1 parent 2a8224e commit 61c600f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/taro-transformer-wx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ export default function transform (options: Options): TransformResult {
// 将来升级到 babel@7 可以直接用 parse 而不是 transform
const ast = parse(code, buildBabelTransformOptions()).ast as t.File
if (options.isNormal) {
if (options.isTyped) {
const mainClassNode = ast.program.body.find(v => {
return t.isClassDeclaration(v)
}) as t.ClassDeclaration | undefined
if (mainClassNode) {
resetTSClassProperty(mainClassNode.body.body)
}
}
return { ast } as any
}
// transformFromAst(ast, code)
Expand Down

0 comments on commit 61c600f

Please sign in to comment.