diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index 74e83927..4fd0be57 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -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);