mirror of
https://github.com/status-im/metro.git
synced 2025-01-15 13:44:20 +00: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:
parent
24b1feae13
commit
a37d8735d7
9
react-packager/src/Server/index.js
vendored
9
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user