sighjs / sigh

multi-process expressive build system for the web and node.js, built using baconjs observables
209 stars 12 forks source link

Source maps after multiple js transpilers are incorrect #30

Closed Strate closed 8 years ago

Strate commented 8 years ago

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?

insidewhy commented 8 years ago

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

insidewhy commented 8 years ago

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

insidewhy commented 8 years ago

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

unlight commented 8 years ago

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

Strate commented 8 years ago

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

insidewhy commented 8 years ago

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