Skip to content

Commit

Permalink
fix(transformer-wx): 修复 H5 编译环境变量错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Feb 13, 2019
1 parent 809cf5d commit 9b8d3c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export default function transform (options: Options): TransformResult {
setLoopOriginal('privateOriginal')
}
THIRD_PARTY_COMPONENTS.clear()
setTransformOptions(options)
const code = options.isTyped
? ts.transpile(options.code, {
jsx: ts.JsxEmit.Preserve,
Expand All @@ -156,6 +155,7 @@ export default function transform (options: Options): TransformResult {
})
: options.code
options.env = Object.assign({ 'process.env.TARO_ENV': options.adapter || 'weapp' }, options.env || {})
setTransformOptions(options)
setting.sourceCode = code
// babel-traverse 无法生成 Hub
// 导致 Path#getSource|buildCodeFrameError 都无法直接使用
Expand Down

0 comments on commit 9b8d3c6

Please sign in to comment.