mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
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:
committed by
facebook-github-bot-7
parent
17c49e2879
commit
753cc7683c
9
packager/react-packager/src/Server/index.js
vendored
9
packager/react-packager/src/Server/index.js
vendored
@@ -361,9 +361,14 @@ 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 = p.getSourceMap({
|
||||||
minify: options.minify,
|
minify: options.minify,
|
||||||
}));
|
});
|
||||||
|
|
||||||
|
if (typeof sourceMap !== 'string') {
|
||||||
|
sourceMap = JSON.stringify(sourceMap);
|
||||||
|
}
|
||||||
|
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(sourceMap);
|
res.end(sourceMap);
|
||||||
Activity.endEvent(startReqEventId);
|
Activity.endEvent(startReqEventId);
|
||||||
|
|||||||
Reference in New Issue
Block a user