mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 22:42:13 +08:00
[ReactNative][Packager] Fix source maps for minified sources
Summary: The packager was ignoring minification for source map requests.
This commit is contained in:
@@ -186,6 +186,10 @@ class Bundle {
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (options.minify) {
|
||||
return this.getMinifiedSourceAndMap().map;
|
||||
}
|
||||
|
||||
if (this._shouldCombineSourceMaps) {
|
||||
return this._getCombinedSourceMaps(options);
|
||||
}
|
||||
|
||||
4
packager/react-packager/src/Server/index.js
vendored
4
packager/react-packager/src/Server/index.js
vendored
@@ -370,7 +370,9 @@ class Server {
|
||||
res.end(bundleSource);
|
||||
Activity.endEvent(startReqEventId);
|
||||
} 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.end(sourceMap);
|
||||
Activity.endEvent(startReqEventId);
|
||||
|
||||
Reference in New Issue
Block a user