From 65aa98597d9bc441147ed39d8366d8d6748cec00 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Wed, 24 Aug 2022 10:55:10 -0700 Subject: [PATCH] Fix 'failed to load source map' warnings in console (#20455) * disable * Skip embedded sourcemaps * comment --- build/lib/util.js | 2 +- build/lib/util.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lib/util.js b/build/lib/util.js index 899c5984ff..5eb4e48344 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -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); diff --git a/build/lib/util.ts b/build/lib/util.ts index 6322c09d8b..8f8ded195c 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -227,7 +227,7 @@ export function rewriteSourceMappingURL(sourceMappingURLBase: string): NodeJS.Re .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; }));