Expose customTransformOptions param on the buildGraph command

Reviewed By: mjesun

Differential Revision: D7759324

fbshipit-source-id: b1f8af7ecb992f97d41b7212467ed95658d88bed
This commit is contained in:
Rafael Oleza 2018-04-26 06:05:15 -07:00 committed by Facebook Github Bot
parent 7f8ee6daa8
commit 373ec95b2b
1 changed files with 6 additions and 1 deletions

View File

@ -59,6 +59,8 @@ type PrivateMetroOptions = {|
watch?: boolean,
|};
import type {CustomTransformOptions} from './JSTransformer/worker';
// We'll be able to remove this to use the one provided by modern versions of
// fs-extra once https://github.com/jprichardson/node-fs-extra/pull/520 will
// have been merged (until then, they'll break on devservers/Sandcastle)
@ -270,11 +272,12 @@ exports.runServer = async ({
type BuildGraphOptions = {|
...PublicMetroOptions,
entries: $ReadOnlyArray<string>,
customTransformOptions?: CustomTransformOptions,
dev?: boolean,
minify?: boolean,
onProgress?: (transformedFileCount: number, totalFileCount: number) => void,
platform?: string,
type: 'module' | 'script',
type?: 'module' | 'script',
|};
type RunBuildOptions = {|
@ -370,6 +373,7 @@ exports.runBuild = async ({
exports.buildGraph = async function({
config,
customTransformOptions = Object.create(null),
dev = false,
entries,
minify = false,
@ -386,6 +390,7 @@ exports.buildGraph = async function({
try {
return await metroServer.buildGraph(entries, {
...MetroServer.DEFAULT_GRAPH_OPTIONS,
customTransformOptions,
dev,
minify,
onProgress,