Fix 'failed to load source map' warnings in console (#20455)

* disable

* Skip embedded sourcemaps

* comment
This commit is contained in:
Charles Gagnon
2022-08-24 10:55:10 -07:00
committed by GitHub
parent 80ec475f93
commit 65aa98597d
2 changed files with 2 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ function rewriteSourceMappingURL(sourceMappingURLBase) {
.pipe(es.mapSync(f => {
const contents = 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));
f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=((?!data:).*)$/gm, str)); // {{SQL CARBON EDIT}} Don't rewrite embedded source maps - some of our dependencies have these (sanitize-html)
return f;
}));
return es.duplex(input, output);

View File

@@ -227,7 +227,7 @@ export function rewriteSourceMappingURL(sourceMappingURLBase: string): NodeJS.Re
.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));
f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=((?!data:).*)$/gm, str)); // {{SQL CARBON EDIT}} Don't rewrite embedded source maps - some of our dependencies have these (sanitize-html)
return f;
}));