mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-26 21:28:04 +00:00
use uploaded node_modules sourcemaps
This commit is contained in:
@@ -220,6 +220,20 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
export function rewriteSourceMappingURL(sourceMappingURLBase: string): NodeJS.ReadWriteStream {
|
||||
const input = es.through();
|
||||
|
||||
const output = input
|
||||
.pipe(es.mapSync<VinylFile, VinylFile>(f => {
|
||||
const contents = (<Buffer>f.contents).toString('utf8');
|
||||
const str = `//# sourceMappingURL=${sourceMappingURLBase}/${path.dirname(f.relative).replace(/\\/g, '/')}/$1`;
|
||||
f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, str));
|
||||
return f;
|
||||
}));
|
||||
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
export function rimraf(dir: string): () => Promise<void> {
|
||||
const result = () => new Promise<void>((c, e) => {
|
||||
let retries = 0;
|
||||
|
||||
Reference in New Issue
Block a user