Resolve Options
The resolve block configures module resolution — currently import aliases, shared by dev, build, HTML, and CSS through a single resolver. See the Aliases guide.
import { defineConfig } from "vantris";
export default defineConfig({
resolve: {
alias: {
"@": "./src",
"~": "./shared",
},
},
});resolve.alias
- Type:
Record<string, string> - Default: unset → falls back to
tsconfig.json
Import aliases. Each key is matched as a prefix and replaced with a path (relative to root, or absolute). Applied everywhere a specifier is resolved — JS/TS, CSS @import and url(), and HTML src/href.
resolve: {
alias: {
"@": "./src",
"@components": "./src/components",
},
}import { thing } from "@/thing"; // → ./src/thing@import "@/styles/base.css"; /* → ./src/styles/base.css */tsconfig fallback
When resolve.alias is omitted entirely, Vantris reads compilerOptions.paths from your tsconfig.json (resolved against baseUrl) as your aliases:
// tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": { "@/*": ["./src/*"] }
}
}This makes @/* work with zero Vantris config.
Explicit config wins, all-or-nothing
An explicit resolve.alias always takes precedence and the tsconfig fallback is ignored. It's not a merge — defining even one alias in the config disables the tsconfig paths fallback entirely.
Matching order
Keys match as prefixes. List longer, more specific keys first so they win over shorter ones:
resolve: {
alias: {
"@/components": "./src/components", // specific
"@": "./src", // fallback
},
}Reserved for future versions
The ResolveConfig interface is shaped to grow. Fields like extensions (override resolution extensions) and conditions (export-map conditions) are reserved in the source but not yet active.
ResolveConfig at a glance
interface ResolveConfig {
alias?: Record<string, string>;
}