Skip to content

Commit

Permalink
feat(transformer): 添加环境变量支持ts编译配置emitDecoratorMetadata (#5830)
Browse files Browse the repository at this point in the history
close #3132
  • Loading branch information
liaoyinglong authored Mar 29, 2020
1 parent 1f6f625 commit 2076b37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-transformer-wx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ export default function transform (options: TransformOptions): TransformResult {
jsx: options.sourcePath.endsWith('.tsx') ? ts.JsxEmit.Preserve : ts.JsxEmit.None,
target: ts.ScriptTarget.ESNext,
importHelpers: true,
noEmitHelpers: true
noEmitHelpers: true,
emitDecoratorMetadata: process.env.TS_METADATA === 'true'
})
: options.code
options.env = Object.assign({ 'process.env.TARO_ENV': options.adapter || 'weapp' }, options.env || {})
Expand Down

0 comments on commit 2076b37

Please sign in to comment.