mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
5b5a89aefa
Summary:This adds support for source maps that can be used for “random access modules” / “unbundles” - source maps contain an extra custom field: `x_facebook_offsets` - this field maps module IDs to line offsets - the source map is built as if all files were concatenated Decoding/symbolication works as follows: - when decoding a stack trace, and a stack frame comes from a filename that contains only numbers and ends with `.js`, look up the additionally needed line offset in the offset map and add it to the original line of the stack frame. - consume the source map as usual Reviewed By: martinbigio Differential Revision: D3072426 fb-gh-sync-id: 827e6dc13b1959f02903baafa7f9e4fc2e0d4bb9 shipit-source-id: 827e6dc13b1959f02903baafa7f9e4fc2e0d4bb9
23 lines
675 B
JavaScript
23 lines
675 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
const {combineSourceMaps} = require('./util');
|
|
|
|
module.exports = ({startupModules, modules}) => {
|
|
const startupModule = {
|
|
code: startupModules.map(m => m.code).join('\n'),
|
|
map: combineSourceMaps({modules: startupModules}),
|
|
};
|
|
return combineSourceMaps({
|
|
modules: [startupModule].concat(modules),
|
|
withCustomOffsets: true,
|
|
});
|
|
};
|