summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/new-ties-change.md5
-rw-r--r--packages/integrations/cloudflare/src/index.ts8
2 files changed, 10 insertions, 3 deletions
diff --git a/.changeset/new-ties-change.md b/.changeset/new-ties-change.md
new file mode 100644
index 000000000..565934411
--- /dev/null
+++ b/.changeset/new-ties-change.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/cloudflare': major
+---
+
+adjusted esbuild config to work with worker environment (fixing solid js ssr)
diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts
index e207bdb44..357f8a064 100644
--- a/packages/integrations/cloudflare/src/index.ts
+++ b/packages/integrations/cloudflare/src/index.ts
@@ -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,