diff --git a/.changeset/orange-windows-battle.md b/.changeset/orange-windows-battle.md new file mode 100644 index 000000000000..37fcb28fabc0 --- /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 12ff00a54b04..e0f055612c0e 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: [