update cloudflare esbuild config (fixing solid ssr) (#4815)

* fixing esbuild platform setting, to enable solid build

* added changeset

* changed change to major

Co-authored-by: AirBorne04 <daniel@floatingpixels.com>
This commit is contained in:
Daniel 2022-09-20 18:36:58 +02:00 committed by GitHub
parent a49bc2f02e
commit ce0b92ba73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': major
---
adjusted esbuild config to work with worker environment (fixing solid js ssr)

View file

@ -67,8 +67,8 @@ export default function createIntegration(args?: Options): AstroIntegration {
}
vite.ssr = {
target: 'webworker',
noExternal: true,
...vite.ssr,
target: 'webworker'
};
}
},
@ -77,7 +77,9 @@ export default function createIntegration(args?: Options): AstroIntegration {
const pkg = fileURLToPath(entryUrl);
await esbuild.build({
target: 'es2020',
platform: 'browser',
platform: 'neutral',
mainFields: ['main', 'module'],
conditions: ['worker', 'node'],
entryPoints: [pkg],
outfile: pkg,
allowOverwrite: true,