@seamstack/vite
v0.2.0
Published
Vite frontend adapter and plugin for SeamStack — wires Vite's dev server and SSR build into the seam pipeline.
Maintainers
Readme
@seamstack/vite
Vite frontend adapter and plugin for SeamStack — wires Vite's dev server and SSR build into the seam pipeline.
pnpm add @seamstack/vite viteUsage
Wire the adapter in seam.config.ts:
import { defineWeave } from '@seamstack/cli'
import vite from '@seamstack/vite/adapter'
import hono from '@seamstack/hono/adapter'
export default defineWeave({
fabric: [vite({ root: './client' }), hono({ entry: './server/index.ts' })],
port: 4567,
})Add the Vite plugin in your vite.config.ts so the dev server can read the seam's wire env (and proxy /api to your backend without you opening this file ever again):
import { defineConfig } from 'vite'
import { seam } from '@seamstack/vite'
export default defineConfig({
plugins: [seam()],
})In seam dev, Vite runs in-process on the main thread — createServer() is awaited directly inside the seam runtime, not spawned. In seam build, the seam invokes Vite's normal build and hands the manifest to your backend adapter.
More
See the SeamStack README for the bigger picture, the mix-and-match support table, and CLI docs.
