Files
angular__angular/tools/package-tools/sourcemap-remap.ts
T
2017-06-16 10:58:34 -07:00

14 lines
483 B
TypeScript

// There are no type definitions available for these imports.
const sorcery = require('sorcery');
/**
* Finds the original sourcemap of the file and maps it to the current file.
* This is useful when multiple transformation happen (e.g TSC -> Rollup -> Uglify)
**/
export async function remapSourcemap(sourceFile: string) {
// Once sorcery loaded the chain of sourcemaps, the new sourcemap will be written asynchronously.
return (await sorcery.load(sourceFile)).write();
}