Skip to content

Commit ace2116

Browse files
authored
fix: use kit.files.src when generating tsconfig.json (#15253)
I noticed the discrepancy and figured I might as well fix it although `kit.files.src` is deprecated. Also, I hope I'm interpreting the TODO correctly. It seems old --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
1 parent f61f118 commit ace2116

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.changeset/true-parts-cheat.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: generate `tsconfig.json` using the value of `kit.files.src`

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ export function get_tsconfig(kit) {
6262
config_relative('vite.config.js'),
6363
config_relative('vite.config.ts')
6464
]);
65-
// TODO(v2): find a better way to include all src files. We can't just use routes/lib only because
66-
// people might have other folders/files in src that they want included.
67-
const src_includes = [kit.files.routes, kit.files.lib, path.resolve('src')].filter((dir) => {
68-
const relative = path.relative(path.resolve('src'), dir);
65+
const src_includes = [kit.files.routes, kit.files.lib, kit.files.src].filter((dir) => {
66+
const relative = path.relative(kit.files.src, dir);
6967
return !relative || relative.startsWith('..');
7068
});
7169
for (const dir of src_includes) {

0 commit comments

Comments
 (0)