VitePluginSvelteDocinfoOptions import type {VitePluginSvelteDocinfoOptions} from 'svelte-docinfo/vite.js'; Options for the svelteDocinfo Vite plugin.
projectRoot?
Absolute path to project root directory.
Defaults to Vite's resolved config.root.
type string
include?
Glob patterns to include (relative to projectRoot; an absolute pattern
inside the root relativizes, an out-of-root one throws — see
normalizeIncludePatterns).
When provided under the default discovery: 'auto', collapses the chain
to glob (exports discovery is skipped). Combining include with
discovery: 'exports' throws at config-resolve time — exports mode
has no concept of include patterns.
Explicit patterns also widen the source scope: their static bases join
sourceOptions.sourcePaths (see widenSourcePathsForInclude), so
include-discovered files outside the configured source paths still emit
modules — and the watcher tracks their changes. A pattern with no static
base ('**\/*.ts', a literal root file) scopes the whole project root
as source and logs an info line; an out-of-root base throws.
When omitted, the glob fallback derives an include from
sourceOptions.sourcePaths via deriveIncludePatterns, so custom
sourcePaths survive the fallback instead of silently defaulting to
src/lib.
type string[]
exclude?
Glob patterns to exclude, applied at both discovery and analysis time.
Takes precedence over sourceOptions.exclude (no merge between the
two). An array replaces the default patterns wholesale — the test,
spec, and internal/ filters are dropped unless re-included — while the
callback form extends them without restating them
((defaults) => [...defaults, '**\/*.gen.ts'] — see ExcludeOption).
The callback always receives the built-in defaults, even when
sourceOptions.exclude is also set (that value is superseded whole).
The always-on baseline (node_modules + dot-directories below a matched
source path) applies beneath it and is unaffected by overrides.
type ExcludeOption
resolveDependencies?
Whether to resolve import dependencies.
When false, the session's resolver returns null for every specifier,
so module dependencies/dependents stay empty.
type boolean
truediscovery?
Discovery strategy for source files.
type Discovery
'auto'see also
distDir?
Dist directory name relative to project root, used for exports-based discovery.
type string
'dist'sourceOptions?
Partial overrides for default source options (SvelteKit src/lib layout).
onDuplicates?
Behavior when duplicate declaration names are found across modules.
type OnDuplicates
hmrDebounceMs?
HMR debounce delay in milliseconds. Coalesces rapid file changes during dev.
type number
100