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:
parent
77d37853cb
commit
c3572fd5e0
2 changed files with 7 additions and 2 deletions
5
.changeset/orange-windows-battle.md
Normal file
5
.changeset/orange-windows-battle.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/cloudflare': minor
|
||||
---
|
||||
|
||||
Change build target from `es2020` to `es2022`, for better support
|
|
@ -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: [
|
||||
|
|
Loading…
Reference in a new issue