[ReactNative][Packager] Fix source maps for minified sources

Summary:
The packager was ignoring minification for source map requests.
This commit is contained in:
Tadeu Zagallo 2015-09-03 12:02:39 -07:00
parent 672b7b0070
commit bcbe99b3af
2 changed files with 7 additions and 1 deletions

View File

@ -186,6 +186,10 @@ class Bundle {
options = options || {}; options = options || {};
if (options.minify) {
return this.getMinifiedSourceAndMap().map;
}
if (this._shouldCombineSourceMaps) { if (this._shouldCombineSourceMaps) {
return this._getCombinedSourceMaps(options); return this._getCombinedSourceMaps(options);
} }

View File

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