Allow RAM bundle output

Summary: Hooks up indexed RAM bundle output for the build.

Reviewed By: jeanlauliac

Differential Revision: D5121515

fbshipit-source-id: 47a540d8ec016a36e21e1daa2876f582dbdb8504
This commit is contained in:
David Aurelio 2017-05-25 10:11:17 -07:00 committed by Facebook Github Bot
parent 7f64874c7d
commit 683c8ddad8
2 changed files with 11 additions and 2 deletions

View File

@ -17,6 +17,7 @@ const seq = require('async/seq');
const virtualModule = require('./module').virtual;
import type {
BuildResult,
Callback,
GraphFn,
GraphResult,
@ -27,7 +28,7 @@ import type {
type BuildFn = (
entryPoints: Iterable<string>,
options: BuildOptions,
callback: Callback<GraphResult>,
callback: Callback<BuildResult>,
) => void;
type BuildOptions = {|
@ -86,9 +87,12 @@ exports.createBuildSetup = (
polyfills,
} = nullthrows(result);
const preludeScript = prelude(optimize);
const prependedScripts = [preludeScript, ...moduleSystem, ...polyfills];
callback(null, {
entryModules,
modules: concat([prelude(optimize)], moduleSystem, polyfills, modules),
modules: concat(prependedScripts, modules),
prependedScripts,
});
});
};

View File

@ -15,6 +15,11 @@ import type {Ast} from 'babel-core';
import type {Console} from 'console';
export type {Transformer} from '../JSTransformer/worker/worker.js';
export type BuildResult = {|
...GraphResult,
prependedScripts: $ReadOnlyArray<Module>,
|};
export type Callback<A = void, B = void>
= (Error => void)
& ((null | void, A, B) => void);