0
我正在使用TypeScript和Rollup的组合,如this article中所示。使用TypeScript和Rollup与TypeScript源地图
因此math.ts
export function square(x: number) {
return x ** 2;
}
export function cube(x: number) {
return x ** 3;
}
和main.ts
import { square } from "./math";
console.log(square(3));
命令后,生成
tsc -t ES5 -m es2015 && rollup -f es -o app.js -m -i main.js
文件app.js
function square(x) {
return Math.pow(x, 2);
}
console.log(square(3));
//# sourceMappingURL=app.js.map
但显然源代码映射是用于捆绑JavaScript而不是TypeScript。这是不知何故可以生成app.ts.map?