Vono is a Vite plugin that minimally transforms your application to run a server with the interface
Request => Promise`
on Node, Deno, Bun, Cloudflare, Netlify, and more.
import { defineConfig } from 'vite'
import vono from '@vonojs/vono'
export default defineConfig({
plugins: [
vono(
clientEntry: "src/client.ts",
serverEntry: "src/server.ts"
)
]
})
import { buildTags } from "vonojs/runtime"
export default (request: Request) => new Response(await buildTags("src/client.ts"), { headers: { 'content-type': 'text/html' }})
By default, Vono will use the Node adaptor to build a Node compatible application.
You can build it with vite build
and run the built app with node dist/server
.
It's recommended you replace the vite preview
command with this as it is not supported with Vono.
- Vike - A React SSR app with Vike.
Made with 💛
Published under MIT License.