File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
examples/solid/start-basic-cloudflare Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,20 @@ import tsConfigPaths from 'vite-tsconfig-paths'
33import { cloudflare } from '@cloudflare/vite-plugin'
44import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
55import 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
721export 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 } ) ,
You can’t perform that action at this time.
0 commit comments