本页还没有译文
本页 5 段还没译成简体中文,下面显示的是英文原文。$app/tsconfig
还没翻译译自英文(svelte.dev)本页 5 段都还没译
This module contains TypeScript configuration tailored for your app. Your own config should extend it — a typical tsconfig.json looks like this:
tsconfig.json
{
"extends": "$app/tsconfig",
"include": ["src", "test"],
"exclude": ["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.
AI 翻译查看英文原文