Skip to content

vuedaViteConfig

Overview

Returns a Vite config fragment for vueda, covering define, resolve.alias, resolve.dedupe, and (optionally) optimizeDeps and server.fs.allow. 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 is linked (pnpm link / file:) 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.
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:151

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2