Skip to content

Commit

Permalink
fix: Add support for vite.config.ts (#6140)
Browse files Browse the repository at this point in the history
TS2307: Cannot find module '@sveltejs/kit/vite' or its corresponding type declarations.

1 import { sveltekit } from "@sveltejs/kit/vite";
                            ~~~~~~~~~~~~~~~~~~~~

Found 1 error in vite.config.ts:1
  • Loading branch information
bfanger committed Aug 22, 2022
1 parent 9a110f5 commit fca688c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-comics-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Fix vite.config.ts "Cannot find module '@sveltejs/kit/vite' or its corresponding type declarations."
2 changes: 1 addition & 1 deletion packages/kit/src/core/sync/write_tsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
const include = ['ambient.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`));
Expand Down

0 comments on commit fca688c

Please sign in to comment.