Skip to content

Commit

Permalink
Fold modulegraphs sourcemap file into metro-source-map
Browse files Browse the repository at this point in the history
Reviewed By: rafeca

Differential Revision: D6711210

fbshipit-source-id: 1d91df189607c032045f604df75b119a87794ca6
  • Loading branch information
Peter van der Zee authored and facebook-github-bot committed Jan 12, 2018
1 parent 199b518 commit 1152a69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
12 changes: 12 additions & 0 deletions packages/metro-source-map/src/source-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,19 @@ function countLines(string) {
return string.split('\n').length;
}

function createIndexMap(
file: string,
sections: Array<IndexMapSection>,
): IndexMap {
return {
version: 3,
file,
sections,
};
}

module.exports = {
createIndexMap,
fromRawMappings,
toBabelSegments,
toSegmentTuple,
Expand Down
4 changes: 2 additions & 2 deletions packages/metro/src/ModuleGraph/output/plain-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

const meta = require('../../shared/output/meta');

const {createIndexMap} = require('./source-map');
const {getModuleCode, concat} = require('./util');
const {createIndexMap} = require('metro-source-map');

import type {OutputFn} from '../types.flow';

Expand Down Expand Up @@ -52,7 +52,7 @@ function asPlainBundle({
return {
code,
extraFiles: [[`${filename}.meta`, meta(code)]],
map: createIndexMap({file: filename, sections}),
map: createIndexMap(filename, sections),
};
}

Expand Down
28 changes: 0 additions & 28 deletions packages/metro/src/ModuleGraph/output/source-map.js

This file was deleted.

0 comments on commit 1152a69

Please sign in to comment.