mirror of https://github.com/status-im/metro.git
Support async transformers
Reviewed By: rafeca, mjesun Differential Revision: D6405491 fbshipit-source-id: 7110135e9f75ab43c03710abfa8e582577662ab3
This commit is contained in:
parent
a766a4a499
commit
b7ba5c7ee1
|
@ -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<Data> {
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue