Output `.meta` files for plain bundles

Summary: Outputs `.meta` files for plain text bundles just like “old packager” did.

Reviewed By: jeanlauliac, cpojer

Differential Revision: D5077649

fbshipit-source-id: eb87999dd899066adeb9756333adb4d79ce04832
This commit is contained in:
David Aurelio 2017-05-17 07:16:21 -07:00 committed by Facebook Github Bot
parent 47f52bae67
commit cce99f44fd
2 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,8 @@
*/
'use strict';
const meta = require('../../../../local-cli/bundle/output/meta');
const {createIndexMap} = require('./source-map');
const {addModuleIdsToModuleWrapper} = require('./util');
@ -41,7 +43,11 @@ module.exports = (
code += `/*# sourceMappingURL=${sourceMapPath}*/`;
}
return {code, map: createIndexMap({file: filename, sections})};
return {
code,
extraFiles: [[`${filename}.meta`, meta(code)]],
map: createIndexMap({file: filename, sections}),
};
}: OutputFn);
const reLine = /^/gm;

View File

@ -78,7 +78,8 @@ export type OutputFn = (
) => OutputResult;
type OutputResult = {|
code: string,
code: string | Buffer,
extraFiles: Iterable<[string, string | Buffer]>,
map: SourceMap,
|};