diff --git a/.changeset/spotty-kangaroos-peel.md b/.changeset/spotty-kangaroos-peel.md new file mode 100644 index 000000000000..db342321a4f8 --- /dev/null +++ b/.changeset/spotty-kangaroos-peel.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[fix] add `$types` to includes for better DX diff --git a/packages/kit/src/core/sync/write_tsconfig.js b/packages/kit/src/core/sync/write_tsconfig.js index 8e3d42ebd89e..b97b1a084aaa 100644 --- a/packages/kit/src/core/sync/write_tsconfig.js +++ b/packages/kit/src/core/sync/write_tsconfig.js @@ -46,7 +46,7 @@ export function write_tsconfig(config, cwd = process.cwd()) { /** @param {string} file */ const config_relative = (file) => posixify(path.relative(config.outDir, file)); - const include = ['ambient.d.ts', config_relative('vite.config.ts')]; + const include = ['ambient.d.ts', './types/**/$types.d.ts', config_relative('vite.config.ts')]; for (const dir of [config.files.routes, config.files.lib]) { const relative = project_relative(path.dirname(dir)); include.push(config_relative(`${relative}/**/*.js`));