File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,28 @@ export function FileRoutesPlugin(options?: HonoSSRFileRouteOptions): Plugin {
2626
2727 return {
2828 name : 'hono-ssr:file-routes' ,
29+ config ( userConfig ) {
30+ // Ensure @soybeanjs /hono-ssr is processed by Vite's SSR pipeline so that
31+ // the virtual:hono-file-routes import inside the package can be resolved.
32+ const existing = userConfig . ssr ?. noExternal ;
33+ if ( existing === true ) {
34+ return ;
35+ }
36+ const packageName = '@soybeanjs/hono-ssr' ;
37+ const currentList = Array . isArray ( existing )
38+ ? existing
39+ : existing
40+ ? [ existing ]
41+ : [ ] ;
42+ if ( currentList . includes ( packageName ) ) {
43+ return ;
44+ }
45+ return {
46+ ssr : {
47+ noExternal : [ ...currentList , packageName ]
48+ }
49+ } ;
50+ } ,
2951 configResolved ( resolvedConfig ) {
3052 config = resolvedConfig ;
3153 } ,
You can’t perform that action at this time.
0 commit comments