Fix minified source maps

Summary: @​public

The source maps generated by uglify are already stringified, and therefore were
being stringified twice.

Reviewed By: @martinbigio

Differential Revision: D2498242
This commit is contained in:
Tadeu Zagallo 2015-10-05 08:45:43 -07:00 committed by facebook-github-bot-7
parent 17c49e2879
commit 753cc7683c
1 changed files with 7 additions and 2 deletions

View File

@ -361,9 +361,14 @@ class Server {
res.end(bundleSource);
Activity.endEvent(startReqEventId);
} else if (requestType === 'map') {
var sourceMap = JSON.stringify(p.getSourceMap({
var sourceMap = p.getSourceMap({
minify: options.minify,
}));
});
if (typeof sourceMap !== 'string') {
sourceMap = JSON.stringify(sourceMap);
}
res.setHeader('Content-Type', 'application/json');
res.end(sourceMap);
Activity.endEvent(startReqEventId);