code: function saveAsIndexedFile(bundle, options, log) {
    const {
      bundleOutput,
      bundleEncoding: encoding,
      sourcemapOutput
    } = options;
  
    log('start');
    const {startupModules, lazyModules, groups} = bundle.getUnbundle();
    log('finish');
  
    const moduleGroups = ModuleGroups(groups, lazyModules);
    const startupCode = joinModules(startupModules);
  
    log('Writing unbundle output to:', bundleOutput);
    const writeUnbundle = writeBuffers(
      fs.createWriteStream(bundleOutput),
      buildTableAndContents(startupCode, lazyModules, moduleGroups, encoding)
    ).then(() => log('Done writing unbundle output'));
  
    const sourceMap =
      buildSourceMapWithMetaData({startupModules, lazyModules, moduleGroups});
  
    return Promise.all([
      writeUnbundle,
      writeSourceMap(sourcemapOutput, JSON.stringify(sourceMap), log),
    ]);
  }
docs: Saves all JS modules of an app as a single file, separated with null bytes.
  The file begins with an offset table that contains module ids and their
  lengths/offsets.
  The module id for the startup code (prelude, polyfills etc.) is the
  empty string.