Using Spotlight with Vite
If your project is using Vite to build, you can add Spotlight as a plugin and it will automatically inject itself into the development server. It will also replace the Vite error pages with itself for more context.
If you have a Sentry SDK you will get a much better experience but Spotlight is already useful on its own.
1. Installation
npm add @spotlightjs/spotlight
pnpm add @spotlightjs/spotlight
yarn add @spotlightjs/spotlight
2. Configuration
import { defineConfig } from 'vitest/config';import spotlight from '@spotlightjs/spotlight/vite-plugin';
export default defineConfig({ plugins: [spotlight()], test: { include: ['src/**/*.{test,spec}.{js,ts}'] }});