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>
This commit is contained in:
Dario Piotrowicz 2023-09-28 19:56:01 +01:00 committed by GitHub
parent 77d37853cb
commit c3572fd5e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': minor
---
Change build target from `es2020` to `es2022`, for better support

View file

@ -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: [