mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-29 16:56:46 +08:00
Unify source map types
Summary: deduplicates / unifies types for source maps across the code base Reviewed By: jeanlauliac Differential Revision: D4955924 fbshipit-source-id: 25cb71031dce835dd7d2bc1c27d6b20050906e81
This commit is contained in:
committed by
Facebook Github Bot
parent
6202e02326
commit
58ba7fc075
@@ -17,7 +17,8 @@ const meta = require('./meta');
|
||||
const relativizeSourceMap = require('../../../packager/src//lib/relativizeSourceMap');
|
||||
const writeFile = require('./writeFile');
|
||||
|
||||
import type Bundle from '../../../packager/src//Bundler/Bundle';
|
||||
import type Bundle from '../../../packager/src/Bundler/Bundle';
|
||||
import type {SourceMap} from '../../../packager/src/lib/SourceMap';
|
||||
import type {OutputOptions, RequestOptions} from '../types.flow';
|
||||
|
||||
function buildBundle(packagerClient: Server, requestOptions: RequestOptions) {
|
||||
@@ -31,7 +32,7 @@ function buildBundle(packagerClient: Server, requestOptions: RequestOptions) {
|
||||
function createCodeWithMap(bundle: Bundle, dev: boolean, sourceMapSourcesRoot?: string): * {
|
||||
const map = bundle.getSourceMap({dev});
|
||||
const sourceMap = relativizeSourceMap(
|
||||
typeof map === 'string' ? JSON.parse(map) : map,
|
||||
typeof map === 'string' ? (JSON.parse(map): SourceMap) : map,
|
||||
sourceMapSourcesRoot);
|
||||
return {
|
||||
code: bundle.getSource({dev}),
|
||||
|
||||
Reference in New Issue
Block a user