Create server middleware for development with HMR and lazy transpiling.

import { createDevMiddleware } from 'vike/server'
 
const {
  devMiddleware, // The development middleware
  viteConfig, // Resolved Vite configuration
  viteServer, // Vite's development server
} = await createDevMiddleware({
  root: './path/to/app', // (optional, but recommended)
  viteConfig: {
    // Some Vite configuration (optional)
  }
})

See usage example for how to use it.

Vite types:

See also