From 5cecc3ee22868f9397792ec80a4b753a07b68f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Buscht=C3=B6ns?= Date: Tue, 23 Jan 2024 17:38:47 +0100 Subject: [PATCH] feat(cli): allow async in capacitor config file (#4299) Co-authored-by: jcesarmobile --- cli/src/config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/config.ts b/cli/src/config.ts index f7463359c..127284f88 100644 --- a/cli/src/config.ts +++ b/cli/src/config.ts @@ -130,7 +130,9 @@ async function loadExtConfigTS( const ts = require(tsPath); // eslint-disable-line @typescript-eslint/no-var-requires const extConfigObject = requireTS(ts, extConfigFilePath) as any; - const extConfig = extConfigObject.default ?? extConfigObject; + const extConfig = extConfigObject.default + ? await extConfigObject.default + : extConfigObject; return { extConfigType: 'ts', @@ -157,7 +159,7 @@ async function loadExtConfigJS( extConfigType: 'js', extConfigName, extConfigFilePath: extConfigFilePath, - extConfig: require(extConfigFilePath), + extConfig: await require(extConfigFilePath), }; } catch (e: any) { fatal(`Parsing ${c.strong(extConfigName)} failed.\n\n${e.stack ?? e}`);