weixin_39644494
weixin_39644494
2020-12-01 18:47

Source maps after multiple js transpilers are incorrect

I am trying to implement this pipeline:


pipelines['build-ts'] = [
        glob({basePath: "src"}, "**/{*.ts,*.tsx}"),
        typescript(),
        babel6({babelrc: path.resolve("./.babelrc")}),
        write("target/src")
    ]

sigh-typescript sigh-babel6

The one and only way to get sourcemaps points to original ts and tsx files is to explicit do this insdie compiler, am I right?

If I set map.sources to [event.path], source maps targets to js and jsx files produced by typescript. Seems that managing sourcemaps with setting sources to [event.path] makes them pointing to latest compiler in pipeline.

Am I missing something?

该提问来源于开源项目:sighjs/sigh

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39804329 weixin_39804329 5月前

    https://github.com/sighjs/sigh-babel/blob/master/src/index.js#L57

    点赞 评论 复制链接分享
  • weixin_39804329 weixin_39804329 5月前

    Oh, you did that! Hm, will have to debug it more. I can help out at the weekend.

    点赞 评论 复制链接分享
  • weixin_39804329 weixin_39804329 5月前

    Okay found the issue myself thanks to your help, will push he fix now. Thanks!

    点赞 评论 复制链接分享
  • weixin_39558391 weixin_39558391 5月前

    I've already implemented typescript plugin. But it is simple, and has lack of settings. https://github.com/unlight/sigh-ts

    点赞 评论 复制链接分享
  • weixin_39644494 weixin_39644494 5月前

    I used your plugin as a start point to write my one:-)

    点赞 评论 复制链接分享
  • weixin_39804329 weixin_39804329 5月前

    Fixed via https://github.com/sighjs/sigh-core/commit/38dbaff0d2709e2b50ab0320b6689bdbd3426530

    点赞 评论 复制链接分享

相关推荐