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:
parent
a49bc2f02e
commit
ce0b92ba73
2 changed files with 10 additions and 3 deletions
5
.changeset/new-ties-change.md
Normal file
5
.changeset/new-ties-change.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/cloudflare': major
|
||||
---
|
||||
|
||||
adjusted esbuild config to work with worker environment (fixing solid js ssr)
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue