# Vite (/docs/bundlers/vite)

conciv runs inside the Vite dev server, through the `conciv()` plugin from `@conciv/it`.

<Callout type="success" title="Prefer to let your agent do it?">
  Copy this prompt into your coding agent. It runs conciv's init command, which makes the same changes as below.

  <SetupPrompt framework="vite" />
</Callout>

## Add conciv to Vite [#add-conciv-to-vite]

Install `@conciv/it` as a dev dependency:

```package-install
npm install -D @conciv/it
```

Add `conciv()` to the plugins of your Vite config:

```ts twoslash title="vite.config.ts"
import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'
import conciv from '@conciv/it/plugin/vite' // [!code ++]

export default defineConfig({
  plugins: [
    react(),
    conciv(), // [!code ++]
  ],
})
```

Options go in the one argument of `conciv()`. Learn more in [Configuration](/docs/reference/configuration).

Start your dev server with `npm run dev`, open your app, and click the conciv button. Type the 6-digit code your dev
server prints. Learn more in [Logging in](/docs/usage/logging-in).

## What works [#what-works]

Every feature works on Vite:

- The widget on every page the dev server serves, and the engine that starts with `vite dev`.
- The [dev server tools](/docs/usage/dev-server): the agent reads your config, URLs and module graph.
- `vite build` leaves conciv out.

## Astro [#astro]

Astro takes Vite plugins under its `vite` key:

```js title="astro.config.mjs"
import {defineConfig} from 'astro/config'
import conciv from '@conciv/it/plugin/vite' // [!code ++]

export default defineConfig({
  vite: {
    plugins: [conciv()], // [!code ++]
  },
})
```

<Accordions type="single">
  <Accordion id="devtools" title="conciv opens in the Vite DevTools dock">
    With Vite DevTools in your plugins, conciv opens in the DevTools dock instead of the corner. It logs in with no
    code. Learn more in [Logging in](/docs/usage/logging-in#vite-devtools).
  </Accordion>
  <Accordion id="card" title="init prints a snippet instead of editing the config">
    init edits only a config shape it can prove: one `plugins` array in the exported config object. For any other shape
    it prints the snippet to paste. Add it as shown above.
  </Accordion>
</Accordions>

## Next steps [#next-steps]

- **[Use conciv](/docs/usage):** what the agent can do in your app.
- **[Configuration](/docs/reference/configuration):** the options `conciv()` takes.
