Skip to content

Commit

Permalink
update cloudflare esbuild config (fixing solid ssr) (withastro#4815)
Browse files Browse the repository at this point in the history
* fixing esbuild platform setting, to enable solid build

* added changeset

* changed change to major

Co-authored-by: AirBorne04 <[email protected]>
  • Loading branch information
AirBorne04 and AirBorne04 committed Sep 20, 2022
1 parent a49bc2f commit ce0b92b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-ties-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': major
---

adjusted esbuild config to work with worker environment (fixing solid js ssr)
8 changes: 5 additions & 3 deletions packages/integrations/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export default function createIntegration(args?: Options): AstroIntegration {
}

vite.ssr = {
target: 'webworker',
noExternal: true,
...vite.ssr,
target: 'webworker'
};
}
},
Expand All @@ -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,
Expand Down

0 comments on commit ce0b92b

Please sign in to comment.