Skip to content

Commit

Permalink
fix(cloudflare): target es2022 instead of es2020 to fix esbuild incom…
Browse files Browse the repository at this point in the history
…patibility 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 <[email protected]>
  • Loading branch information
dario-piotrowicz and alexanderniebuhr authored Sep 28, 2023
1 parent 77d3785 commit c3572fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit c3572fd

Please sign in to comment.