mirror of https://github.com/status-im/metro.git
[ReactNative][Packager] Fix source maps for minified sources
Summary: The packager was ignoring minification for source map requests.
This commit is contained in:
parent
672b7b0070
commit
bcbe99b3af
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue