Expose type parameter on the buildGraph command

Reviewed By: davidaurelio

Differential Revision: D7654256

fbshipit-source-id: c3d97a1564ed06561b071ca412b14655f46cbc4f
This commit is contained in:
Rafael Oleza 2018-04-18 12:09:06 -07:00 committed by Facebook Github Bot
parent 47793c25a5
commit 310c096671
1 changed files with 3 additions and 0 deletions

View File

@ -281,6 +281,7 @@ type BuildGraphOptions = {|
dev?: boolean, dev?: boolean,
onProgress?: (transformedFileCount: number, totalFileCount: number) => void, onProgress?: (transformedFileCount: number, totalFileCount: number) => void,
platform?: string, platform?: string,
type: 'module' | 'script',
|}; |};
type RunBuildOptions = {| type RunBuildOptions = {|
@ -380,6 +381,7 @@ exports.buildGraph = async function({
entries, entries,
onProgress, onProgress,
platform = `web`, platform = `web`,
type = 'module',
...rest ...rest
}: BuildGraphOptions): Promise<Graph> { }: BuildGraphOptions): Promise<Graph> {
const metroServer = await runMetro({ const metroServer = await runMetro({
@ -393,6 +395,7 @@ exports.buildGraph = async function({
dev, dev,
onProgress, onProgress,
platform, platform,
type,
}); });
} finally { } finally {
await metroServer.end(); await metroServer.end();