Skip to content

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 ​

NameTypeRequiredDescription
optionsobjectnoConfiguration options.

options Properties ​

NameTypeRequiredDefaultDescription
debugbooleanLog the resolved wiring and dedupe strategy. Defaults to false.
enableDedupebooleanWhether to de-duplicate shared peer dependencies. Defaults to true.
enableRuntimeAliasesbooleanWhether to pin vue/pinia/vue-router to their bundler builds. Defaults to true.
excludeFromDedupestring[]Peer dependency names to leave out of resolve.dedupe.
extraAliasesanyAdditional aliases to include. Pass @ pointing to the consumer's src directory to discover convention-named action views.
extraDedupestring[]Additional package names to add to resolve.dedupe.
manageLinkedOptimizeDepsbooleanManage dep pre-bundling for linked packages: pre-bundle linked reactive-helpers (single instance) and keep linked VUEDA as source. Defaults to true.
optimizeDepsanyVite optimizeDeps overrides (merged with the computed include/exclude).
rootstringThe project root directory. Defaults to process.cwd().

Returns ​

UserConfig

A partial Vite config fragment.

Source ​

client/lib/vite.js:154