How to use the metro-source-map.createIndexMap function in metro-source-map

To help you get started, we’ve selected a few metro-source-map examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Marwan01 / food-converter / node_modules / metro / src / ModuleGraph / output / plain-bundle.js View on Github external
* This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 *
 * @format
 */
"use strict";

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

const _require = require("./util"),
  getModuleCodeAndMap = _require.getModuleCodeAndMap,
  concat = _require.concat;

const _require2 = require("metro-source-map"),
  createIndexMap = _require2.createIndexMap;

function asPlainBundle(_ref) {
  let filename = _ref.filename,
    idsForPath = _ref.idsForPath,
    modules = _ref.modules,
    requireCalls = _ref.requireCalls,
    sourceMapPath = _ref.sourceMapPath,
    enableIDInlining = _ref.enableIDInlining;
  let code = "";
  let line = 0;
  const sections = [];

  const modIdForPath = x => idsForPath(x).moduleId;

  for (const module of concat(modules, requireCalls)) {
    const _getModuleCodeAndMap = getModuleCodeAndMap(module, modIdForPath, {