mirror of https://github.com/status-im/metro.git
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:
parent
b512cf62af
commit
9ffddb1b32
|
@ -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;
|
||||
|
|
|
@ -78,7 +78,8 @@ export type OutputFn = (
|
|||
) => OutputResult;
|
||||
|
||||
type OutputResult = {|
|
||||
code: string,
|
||||
code: string | Buffer,
|
||||
extraFiles: Iterable<[string, string | Buffer]>,
|
||||
map: SourceMap,
|
||||
|};
|
||||
|
||||
|
|
Loading…
Reference in New Issue