# ondine/vite

Compile Mermaid file imports to SVG during the Vite build.

The `ondine/vite` entrypoint exports one Vite plugin. The plugin requires Vite as a peer dependency. It compiles with the same module as `ondine/compiler`. The [Vite](/docs/guides/vite) guide shows common tasks.

```ts title="vite.config.ts"
import { defineConfig } from 'vite'
import { ondine } from 'ondine/vite'

export default defineConfig({
  // Compiles .mmd and .mermaid imports
  plugins: [ondine()],
})
```

## Functions

- [ondine](/docs/api/vite/ondine): The Vite plugin and its rendering options.

## Types

The `ondine/vite/client` module declares the default export of `.mmd` and `.mermaid` imports as `{ height, svg, type, width }`.

```ts title="src/env.d.ts"
// Types every Mermaid import in the project
/// <reference types="ondine/vite/client" />
```
