Skip to content

Commit e8e38a1

Browse files
committed
fix integration
1 parent eee3e78 commit e8e38a1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/solid/start-basic-cloudflare/vite.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ import tsConfigPaths from 'vite-tsconfig-paths'
33
import { cloudflare } from '@cloudflare/vite-plugin'
44
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
55
import viteSolid from 'vite-plugin-solid'
6+
import type { Plugin } from 'vite'
7+
8+
// Plugin to clear resolve.external for Cloudflare compatibility
9+
function clearSsrExternal(): Plugin {
10+
return {
11+
name: 'clear-ssr-external',
12+
enforce: 'pre',
13+
configResolved(config) {
14+
// Clear external packages from SSR environment for Cloudflare compatibility
15+
const ssrEnv = config.environments.ssr
16+
ssrEnv.resolve.external = []
17+
},
18+
}
19+
}
620

721
export default defineConfig({
822
server: {
@@ -12,6 +26,7 @@ export default defineConfig({
1226
tsConfigPaths({
1327
projects: ['./tsconfig.json'],
1428
}),
29+
clearSsrExternal(),
1530
cloudflare({ viteEnvironment: { name: 'ssr' } }),
1631
tanstackStart(),
1732
viteSolid({ ssr: true }),

0 commit comments

Comments
 (0)