summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dario Piotrowicz <dario.piotrowicz@gmail.com> 2023-09-28 19:56:01 +0100
committerGravatar GitHub <noreply@github.com> 2023-09-28 20:56:01 +0200
commitc3572fd5e0e3864cd728f83502a52e9274793ee2 (patch)
tree08d199f225b954090e49399a013da92cfd55e948
parent77d37853cb109cb30bdc7aecd7eea8f8c9b3a9c3 (diff)
downloadastro-c3572fd5e0e3864cd728f83502a52e9274793ee2.tar.gz
astro-c3572fd5e0e3864cd728f83502a52e9274793ee2.tar.zst
astro-c3572fd5e0e3864cd728f83502a52e9274793ee2.zip
fix(cloudflare): target es2022 instead of es2020 to fix esbuild incompatibility issues (#8682)
* fix(cloudflare): target es2022 instead of es2020 to fix esbuild incompatibility issues * add changeset * update changeset * fix(cloudflare): change build target to es2022 --------- Co-authored-by: Alexander Niebuhr <alexander@nbhr.io>
Diffstat (limited to '')
-rw-r--r--.changeset/orange-windows-battle.md5
-rw-r--r--packages/integrations/cloudflare/src/index.ts4
2 files changed, 7 insertions, 2 deletions
diff --git a/.changeset/orange-windows-battle.md b/.changeset/orange-windows-battle.md
new file mode 100644
index 000000000..37fcb28fa
--- /dev/null
+++ b/.changeset/orange-windows-battle.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/cloudflare': minor
+---
+
+Change build target from `es2020` to `es2022`, for better support
diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts
index 12ff00a54..e0f055612 100644
--- a/packages/integrations/cloudflare/src/index.ts
+++ b/packages/integrations/cloudflare/src/index.ts
@@ -232,7 +232,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
fileURLToPath(assetsUrl)
);
await esbuild.build({
- target: 'es2020',
+ target: 'es2022',
platform: 'browser',
conditions: ['workerd', 'worker', 'browser'],
external: [
@@ -313,7 +313,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: [