This directory contains examples demonstrating how to use @fastify/vite with various frameworks and configurations.
These examples serve two purposes:
-
Usage Examples — Reference implementations showing how to integrate Vite with Fastify for different use cases (React, Vue, SSR, SPA, TypeScript, etc.)
-
Integration Tests — Examples with a
server.test.jsfile run as part of CI to ensure@fastify/viteworks correctly across different configurations
To run all example integration tests:
pnpm test:examplesTo run tests for a specific example:
cd examples/react-vanilla
pnpm testSome examples exist primarily to reproduce and test specific issues:
prefix-support— Reproduces issue #358 (static routes respect registration prefix)relative-outdir— Reproduces issue #303 (nested root with relative outDir)