From 69352087cf594c6cb48493685c6d36cf4fd96a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Charles?= Date: Fri, 9 Aug 2024 01:03:23 +0200 Subject: [PATCH] fix: default build target to es2022 --- .gitignore | 2 ++ packages/vike-cloudflare/src/index.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 44624cf..4a56258 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,5 @@ dist # Cloudflare .wrangler/ + +.idea diff --git a/packages/vike-cloudflare/src/index.ts b/packages/vike-cloudflare/src/index.ts index 63a835e..5766817 100644 --- a/packages/vike-cloudflare/src/index.ts +++ b/packages/vike-cloudflare/src/index.ts @@ -57,6 +57,12 @@ export const pages = (options?: VikeCloudflarePagesOptions): Plugin => { return getAsset(options?.server?.kind); } }, + config(userConfig) { + if (!userConfig.build?.target) { + userConfig.build ??= {}; + userConfig.build.target = 'es2022'; + } + }, configResolved: async (config) => { resolvedConfig = config; },