Skip to content

Commit 7875003

Browse files
[fix] add $types to includes for better DX (#7301)
* [fix] add $types to includes for better DX $types.d.ts files not referenced in user code were not loaded on startup in the IDE, because the includes list did not contain references to them. This resulted in suboptimal DX. * Update .changeset/spotty-kangaroos-peel.md Co-authored-by: Rich Harris <[email protected]>
1 parent 4e9c578 commit 7875003

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/spotty-kangaroos-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
[fix] add `$types` to includes for better DX

packages/kit/src/core/sync/write_tsconfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function write_tsconfig(config, cwd = process.cwd()) {
4646
/** @param {string} file */
4747
const config_relative = (file) => posixify(path.relative(config.outDir, file));
4848

49-
const include = ['ambient.d.ts', config_relative('vite.config.ts')];
49+
const include = ['ambient.d.ts', './types/**/$types.d.ts', config_relative('vite.config.ts')];
5050
for (const dir of [config.files.routes, config.files.lib]) {
5151
const relative = project_relative(path.dirname(dir));
5252
include.push(config_relative(`${relative}/**/*.js`));

0 commit comments

Comments
 (0)