diff --git a/packages/metro-bundler/src/JSTransformer/worker/index.js b/packages/metro-bundler/src/JSTransformer/worker/index.js index f8603a70..781efcad 100644 --- a/packages/metro-bundler/src/JSTransformer/worker/index.js +++ b/packages/metro-bundler/src/JSTransformer/worker/index.js @@ -93,13 +93,13 @@ export type Data = { transformFileEndLogEntry: LogEntry, }; -function transformCode( +async function transformCode( transformer: Transformer<*>, filename: string, localPath: LocalPath, sourceCode: string, options: Options, -): Data { +): Promise { const isJson = filename.endsWith('.json'); if (isJson) { @@ -118,7 +118,7 @@ function transformCode( ? [] : [[inline.plugin, options], [constantFolding.plugin, options]]; - const result = transformer.transform({ + const result = await transformer.transform({ filename, localPath, options: options.transform,