Skip to content

Vite Quick Start

1. Install

bash
pnpm add -D mokup
bash
npm install -D mokup
bash
yarn add -D mokup
bash
bun add -d mokup

2. Enable the plugin

ts
import mokup from 'mokup/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    mokup({
      entries: {
        dir: 'mock',
        prefix: '/api',
      },
    }),
  ],
})

3. Start dev server

bash
pnpm dev
bash
npm run dev
bash
yarn dev
bash
bun run dev

4. Verify

  • http://localhost:5173/api/users
  • http://localhost:5173/__mokup

Next

See the full options in Vite Plugin.