Skip to content

Commit

Permalink
refactor(transformer): isNormal 的情况下也把函数式组件改为类组件
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jul 11, 2019
1 parent fedad06 commit d0bc3bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-transformer-wx/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const buildBabelTransformOptions: () => TransformOptions = () => {
[require('babel-plugin-transform-define').default, transformOptions.env]
]
if (!transformOptions.isNormal) {
plugins.push(buildVistor(), functionalComponent)
plugins.push(buildVistor())
}
return {
parserOpts: {
Expand All @@ -57,6 +57,7 @@ export const buildBabelTransformOptions: () => TransformOptions = () => {
] as any[]
},
plugins: plugins
.concat(functionalComponent)
.concat(process.env.ESLINT === 'false' || transformOptions.isNormal || transformOptions.isTyped ? [] : eslintValidation)
.concat((isTestEnv) ? [] : require('babel-plugin-remove-dead-code').default)
}
Expand Down

0 comments on commit d0bc3bd

Please sign in to comment.