mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
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 = {
|
vite.ssr = {
|
||||||
target: 'webworker',
|
...vite.ssr,
|
||||||
noExternal: true,
|
target: 'webworker'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -77,7 +77,9 @@ export default function createIntegration(args?: Options): AstroIntegration {
|
||||||
const pkg = fileURLToPath(entryUrl);
|
const pkg = fileURLToPath(entryUrl);
|
||||||
await esbuild.build({
|
await esbuild.build({
|
||||||
target: 'es2020',
|
target: 'es2020',
|
||||||
platform: 'browser',
|
platform: 'neutral',
|
||||||
|
mainFields: ['main', 'module'],
|
||||||
|
conditions: ['worker', 'node'],
|
||||||
entryPoints: [pkg],
|
entryPoints: [pkg],
|
||||||
outfile: pkg,
|
outfile: pkg,
|
||||||
allowOverwrite: true,
|
allowOverwrite: true,
|
||||||
|
|
Loading…
Reference in a new issue