Skip to content

Vite Plugin

The @loewen-digital/fullstack Vite plugin adds development tooling to your build: the Dev UI panel, virtual module support, and hot-reload awareness for configuration changes.

Import

ts
import { fullstack } from '@loewen-digital/fullstack/vite'

Setup

Add the plugin to your vite.config.ts:

ts
import { defineConfig } from 'vite'
import { sveltekit } from '@sveltejs/kit/vite'
import { fullstack } from '@loewen-digital/fullstack/vite'

export default defineConfig({
  plugins: [
    sveltekit(),
    fullstack({
      // Enable the Dev UI at /_fullstack
      devUI: true,
    }),
  ],
})

Features

Dev UI

When devUI: true, the plugin mounts a development panel at /_fullstack (in dev mode only). The Dev UI provides:

  • Mail preview — view all emails sent via the console driver in a browser
  • Queue inspector — view pending, processing, and failed jobs
  • Cache explorer — inspect cache keys and values
  • Session viewer — debug session contents for the current user
  • Log viewer — tail structured logs in real time

The Dev UI is never included in production builds.

Configuration hot-reload

When your fullstack.config.ts changes, the plugin triggers a module reload without requiring a full server restart.

Type generation

The plugin can generate TypeScript types from your database schema and route configuration:

ts
fullstack({
  devUI: true,
  generateTypes: true, // writes to src/fullstack.d.ts
})

Config options

OptionTypeDefaultDescription
devUIbooleanfalseEnable the Dev UI panel in development
devUI.pathstring'/_fullstack'URL path for the Dev UI
generateTypesbooleanfalseAuto-generate TypeScript types from schema
configFilestring'fullstack.config'Path to the stack config file