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:
parent
6ca492a4d2
commit
aa02d19db7
|
@ -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,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue