Open elliot-nelson opened 5 years ago
The compiler already uses incoming source maps, but it only uses them for the generation of the output source maps. I haven't thought about your use case before, but I think it would be a logical extension to also use the incoming source maps to map the source locations of errors. If you would want to implement this, you can do that in Output#getError
. The source-map package will probably give you some useful functions to map source locations to the original locations.
However, for you particular use case, you may also want to look at the out
option of TypeScript. That may be an alternative which requires a lot less effort to implement.
I'm trying to use gulp-typescript to generate javascript for some typescript files that don't use any module system; it concatenates all the files together and then compiles to produce a single JS file.
The output of this task works perfectly (
dist/js/app.js
contains the fully tersed javascript with correct source maps). But, when typescript compiler gets an error, it doesn't know about the source maps, so the compiler errors refer to the intermediate concatenated file instead of the original typescript files.Expected behavior:
Actual behavior:
Your gulpfile:
Any ideas on how I could have the compiler know about the "pre-compilation" source maps?