---
url: "https://vueda.dev/v3/reference/api/js/vite/functions/vuedaViteConfig.md"
title: "vuedaViteConfig"
---

# vuedaViteConfig

## Overview

Returns a Vite config fragment for vueda, covering `define`, `resolve.alias`, `resolve.dedupe`, and
(optionally) `optimizeDeps`, `server.fs.allow`, and action-view import transforms. Spread the result into
your Vite `defineConfig` or merge it with `mergeConfig`.

The fragment guarantees a single copy of VUEDA, reactive-helpers, and their shared peer dependencies by
listing them in `resolve.dedupe`, which forces every bare import (from any importer, including a linked
package's own internal imports) to resolve from this project's root. This works regardless of whether the
packages are installed or linked, and regardless of pnpm's symlinked/hoisted store layout.

When vueda resolves to an external checkout, its source lives outside the consuming project, which Vite's
dev server will not serve unless the path is on `server.fs.allow`. In that case the fragment returns a
`server.fs.allow` listing the workspace root plus the linked vueda source realpath. The list mirrors Vite's
default (the workspace root) so it is safe to spread; but if you also declare your own `server` block,
spreading both will let the later one win and drop this allow-list. Merge instead: either wrap with
`mergeConfig(vuedaViteConfig(...), { server: { ... } })`, or inside your `server` block preserve
`fs.allow` (e.g. `fs: { allow: [...(vueda.server?.fs?.allow ?? []), ...yourEntries] }`).

## Signature

`vuedaViteConfig(options)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-options">options</span> | `object` | no | Configuration options. |

#### options Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-options-debug">debug</span> | `boolean` |  |  | Log the resolved wiring and dedupe strategy. Defaults to false. |
| <span id="param-options-enableDedupe">enableDedupe</span> | `boolean` |  |  | Whether to de-duplicate shared peer dependencies. Defaults to true. |
| <span id="param-options-enableRuntimeAliases">enableRuntimeAliases</span> | `boolean` |  |  | Whether to pin vue/pinia/vue-router to their bundler builds. Defaults to true. |
| <span id="param-options-excludeFromDedupe">excludeFromDedupe</span> | `string[]` |  |  | Peer dependency names to leave out of `resolve.dedupe`. |
| <span id="param-options-extraAliases">extraAliases</span> | `any` |  |  | Additional aliases to include.   Pass `@` pointing to the consumer's `src` directory to discover convention-named action views. |
| <span id="param-options-extraDedupe">extraDedupe</span> | `string[]` |  |  | Additional package names to add to `resolve.dedupe`. |
| <span id="param-options-manageLinkedOptimizeDeps">manageLinkedOptimizeDeps</span> | `boolean` |  |  | Manage dep pre-bundling for linked packages: pre-bundle   linked reactive-helpers (single instance) and keep linked VUEDA as source. Defaults to true. |
| <span id="param-options-optimizeDeps">optimizeDeps</span> | `any` |  |  | Vite optimizeDeps overrides (merged with the computed include/exclude). |
| <span id="param-options-root">root</span> | `string` |  |  | The project root directory. Defaults to process.cwd(). |

### Returns

`UserConfig`

A partial Vite config fragment.

## Source

`client/lib/vite.js:154`
