2017-05-23 00:02:08 +02:00
|
|
|
// 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.
|
2018-01-25 16:36:31 -02:00
|
|
|
* This is useful when multiple transformation happen (e.g `TSC -> Rollup -> Uglify`)
|
2018-01-18 15:41:39 -03:00
|
|
|
*/
|
2017-05-23 00:02:08 +02:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|