From aa3ceb466fb5b138ee9c8e7eec25c360d97dd66c Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 8 Aug 2014 00:24:51 +0200 Subject: [PATCH] Remove sourcemap linking with a `//#` comment Firefox now supports sourcemap linking using a HTTP response header Firefox print a lot of warning when using the `//#` linking --- tools/bundler.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tools/bundler.js b/tools/bundler.js index 4f18f57fa7..00de0b103b 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -940,17 +940,6 @@ _.extend(ClientTarget.prototype, { // Use a SHA to make this cacheable. var sourceMapBaseName = file.hash() + ".map"; - // XXX When we can, drop all of this and just use the SourceMap - // header. FF doesn't support that yet, though: - // https://bugzilla.mozilla.org/show_bug.cgi?id=765993 - // Note: if we use the older '//@' comment, FF 24 will print a lot - // of warnings to the console. So we use the newer '//#' comment... - // which Chrome (28) doesn't support. So we also set X-SourceMap - // in webapp_server. - file.setContents(Buffer.concat([ - file.contents(), - new Buffer("\n//# sourceMappingURL=" + sourceMapBaseName + "\n") - ])); manifestItem.sourceMapUrl = require('url').resolve( file.url, sourceMapBaseName); } @@ -1200,12 +1189,6 @@ _.extend(JsImage.prototype, { { data: new Buffer(item.sourceMap, 'utf8') } ); - var sourceMapFileName = path.basename(loadItem.sourceMap); - // Remove any existing sourceMappingURL line. (eg, if roundtripping - // through JsImage.readFromDisk, don't end up with two!) - item.source = item.source.replace( - /\n\/\/# sourceMappingURL=.+\n?$/, ''); - item.source += "\n//# sourceMappingURL=" + sourceMapFileName + "\n"; loadItem.sourceMapRoot = item.sourceMapRoot; }