Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudflare): target es2022 instead of es2020 to fix esbuild incompatibility issues #8682

Merged
merged 10 commits into from
Sep 28, 2023
5 changes: 5 additions & 0 deletions .changeset/orange-windows-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': minor
---

Change build target from `es2020` to `es2022`, for better support
4 changes: 2 additions & 2 deletions packages/integrations/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
Expand Down