Can src ➜ tsc ➜ rollup ➜ `source maps` point back to the original TypeScript src?

Viewed 1241

I'm using combination of TypeScript and Rollup as is presented in this article.

Thus math.ts

export function square(x: number) {
    return x ** 2;
}

export function cube(x: number) {
    return x ** 3;
}

and main.ts

import { square } from "./math";

console.log(square(3));

generates after command

tsc -t ES5 -m es2015 && rollup -f es -o app.js -m -i main.js

file app.js

function square(x) {
    return Math.pow(x, 2);
}

console.log(square(3));
//# sourceMappingURL=app.js.map

But the generated source map points to the .js output of tsc, not the original .ts files. How can I get the latter?

1 Answers
Related