$app/tsconfig
This module contains TypeScript configuration tailored for your app. Your own config should extend it — a typical tsconfig.json looks like this:
tsconfig
{
"extends": "$app/tsconfig",
"includes": ["src", "test"],
"excludes": ["src/service-worker"]
}You can extend this configuration with your own compilerOptions. Overriding the following properties may cause things to break — SvelteKit will warn you if this happens:
paths— this is derived from the (deprecated)aliasconfig option, together with any subpath imports specified in yourpackage.json, to align behaviour between Vite and TypeScript. Ideally, configure subpath imports rather than usingpathsdirectlytypes— your app needs to be able to 'see' generated module declarations for things like environment variables, and as such this array must include"$app/types"isolatedModules— must betrue, as Vite compiles modules one at a timeverbatimModuleSyntax— must betrue, so that you can safely use type imports in.sveltefiles
Note that the example configuration above excludes src/service-worker, because service workers need to be in their own TypeScript project. If you are using a service worker, create a src/service-worker/tsconfig.json that extends $app/tsconfig/service-worker.
Edit this page on GitHub llms.txt
previous next