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
This commit is contained in:
Maxime Quandalle
2014-08-08 00:24:51 +02:00
committed by David Glasser
parent 5a8f843282
commit aa3ceb466f

View File

@@ -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;
}