mirror of https://github.com/status-im/metro.git
Expose customTransformOptions param on the buildGraph command
Reviewed By: mjesun Differential Revision: D7759324 fbshipit-source-id: b1f8af7ecb992f97d41b7212467ed95658d88bed
This commit is contained in:
parent
7f8ee6daa8
commit
373ec95b2b
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue