From 859f217aa08c5a79e3905e14b0822a44cbdf36f6 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Wed, 27 Sep 2023 19:40:41 +0100 Subject: [PATCH 1/4] fix(cloudflare): target es2022 instead of es2020 to fix esbuild incompatibility issues --- packages/integrations/cloudflare/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index 792aec196b2f..c97f0ea7d416 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -349,7 +349,7 @@ export default function createIntegration(args?: Options): AstroIntegration { fileURLToPath(assetsUrl) ); await esbuild.build({ - target: 'es2020', + target: 'es2022', platform: 'browser', conditions: ['workerd', 'worker', 'browser'], external: [ From d5459a9d629e51f1890466a8fc0754d1518f2d93 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Wed, 27 Sep 2023 20:07:54 +0100 Subject: [PATCH 2/4] add changeset --- .changeset/orange-windows-battle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-windows-battle.md diff --git a/.changeset/orange-windows-battle.md b/.changeset/orange-windows-battle.md new file mode 100644 index 000000000000..779aba3fb938 --- /dev/null +++ b/.changeset/orange-windows-battle.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': minor +--- + +target es2022 instead of es2020 to fix esbuild incompatibility issues From 6618324ee7d7f0c3b6b33f3a073061fa537dc413 Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Thu, 28 Sep 2023 08:35:10 +0200 Subject: [PATCH 3/4] update changeset --- .changeset/orange-windows-battle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/orange-windows-battle.md b/.changeset/orange-windows-battle.md index 779aba3fb938..37fcb28fabc0 100644 --- a/.changeset/orange-windows-battle.md +++ b/.changeset/orange-windows-battle.md @@ -2,4 +2,4 @@ '@astrojs/cloudflare': minor --- -target es2022 instead of es2020 to fix esbuild incompatibility issues +Change build target from `es2020` to `es2022`, for better support From f4dc7a3eab81571df2bb59bf200af5bcb6badcbb Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Thu, 28 Sep 2023 08:36:29 +0200 Subject: [PATCH 4/4] fix(cloudflare): change build target to es2022 --- packages/integrations/cloudflare/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index c97f0ea7d416..18ae7e4cda70 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -427,7 +427,7 @@ export default function createIntegration(args?: Options): AstroIntegration { const finalBuildUrl = pathToFileURL(buildPath.replace(/\.mjs$/, '.js')); await esbuild.build({ - target: 'es2020', + target: 'es2022', platform: 'browser', conditions: ['workerd', 'worker', 'browser'], external: [