From bb03183c9485d259408a30ddc38be7171ec3fef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 11 Apr 2024 02:57:00 +0200 Subject: [PATCH] chore(cf-pages): only create wrangler.toml if config is not empty (#2356) Co-authored-by: Pooya Parsa --- src/presets/cloudflare-pages.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/presets/cloudflare-pages.ts b/src/presets/cloudflare-pages.ts index 479a971db5..bff8354996 100644 --- a/src/presets/cloudflare-pages.ts +++ b/src/presets/cloudflare-pages.ts @@ -225,6 +225,11 @@ async function writeCFWrangler(nitro: Nitro) { const inlineConfig: WranglerConfig = nitro.options.cloudflare?.wrangler || ({} as WranglerConfig); + // Write wrangler.toml only if config is not empty + if (Object.keys(inlineConfig).length === 0) { + return; + } + let configFromFile: WranglerConfig = {} as WranglerConfig; const configPath = resolve( nitro.options.rootDir,