Tool - Vite
Align TypeScript with how Vite resolves and transpiles your code, so the compiler type-checks while Vite owns the build output.
Why Use This Preset?
- Sets
moduleResolutiontoBundlerso TypeScript resolves imports the same way Vite does. - Enables
isolatedModulesso each file type-checks safely under Vite's per-file transpilation. - Turns on
noEmitso TypeScript only checks types and never competes with Vite for build output. - Ships browser
libdefaults so DOM andESNextglobals are available without extra wiring. - Sits last in the
extendschain so its bundler-oriented settings layer cleanly over the base presets.
Usage
Add the preset as the final entry in your tsconfig.json extends chain, after the essentials, strict, and runtime layers.
tsconfig.json
{
"extends": [
"@cbnventures/nova/presets/tsconfig/dx-essentials.json",
"@cbnventures/nova/presets/tsconfig/dx-strict.json",
"@cbnventures/nova/presets/tsconfig/runtime-browser.json",
"@cbnventures/nova/presets/tsconfig/tool-vite.json"
],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": [
"./src/*"
]
},
"rootDir": "./",
"types": [
"vite/client"
]
},
"include": [
"./*",
"./src/**/*"
],
"exclude": [
"./dist/**",
"./node_modules/**"
]
}
What This Preset Configures
The preset sets the following compilerOptions to match Vite's bundler-driven workflow.
| Setting | Value | Description |
|---|---|---|
isolatedModules | true | Enforces per-file type safety since Vite transpiles each file alone. |
lib | ["DOM", "DOM.Iterable", "ESNext"] | Exposes browser DOM APIs and the latest ESNext library features. |
module | "ESNext" | Emits modern ECMAScript module syntax for the bundler to consume. |
moduleResolution | "Bundler" | Resolves imports the way Vite does, including bare and extensionless paths. |
noEmit | true | Type-checks only and leaves build output to Vite. |
Related
- Review the layering order in TSConfig Best Practices.
- See how presets compose end to end in the Presets Overview.