Vite plugin for Fastify with Hot Module Replacement (HMR) support. Version 1.2.6 is current; release cadence is low (occasional updates). Integrates Fastify server into Vite dev and build pipelines. Key differentiator: provides HMR for Fastify routes during development, unlike vanilla Fastify setup. Does not support WebSocket; use vite-node as workaround. Ships TypeScript declarations, ESM-only. Requires Vite and Fastify as peer dependencies.
npm install vite-plugin-fastifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Vite with vite-plugin-fastify, defines a Fastify app with a route, and starts the server with HMR.
Use vite-node instead of Vite dev server: change script to 'vite-node -w src/server.ts'. Disable devMode with { devMode: false } if needed.Use import.meta.glob or consider vite-plugin-fastify-routes for file-based routing.
Add import.meta.hot.dispose and on('vite:beforeFullReload') handlers to close the server.Ensure app.ts exports a function that creates and returns the Fastify instance.
Use import syntax or convert project to ESM (add "type": "module" to package.json).
Use correct ESM default import: import fastify from 'vite-plugin-fastify'.
No dependency data recorded yet.