fix: resolve TypeScript errors in vite.config.ts

- Install @types/node for node:path, node:process, node:url
- Import defineConfig from vitest/config for test config type
- Add types: ["node"] to tsconfig.json

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 13:28:05 -04:00
parent 4bf65458d0
commit 3eebe01d63
4 changed files with 21 additions and 1 deletions

18
package-lock.json generated
View File

@@ -19,6 +19,7 @@
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tauri-apps/cli": "^2",
"@testing-library/svelte": "^5.2.8",
"@types/node": "^26.6.2",
"jsdom": "^26.1.0",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",
@@ -928,6 +929,16 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/node": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz",
"integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~8.9.0"
}
},
"node_modules/@vitest/mocker": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.1.tgz",
@@ -2122,6 +2133,13 @@
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
"dev": true,
"license": "MIT"
},
"node_modules/vite": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.0.tgz",

View File

@@ -23,6 +23,7 @@
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tauri-apps/cli": "^2",
"@testing-library/svelte": "^5.2.8",
"@types/node": "^26.6.2",
"jsdom": "^26.1.0",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",

View File

@@ -12,6 +12,7 @@
"module": "ESNext",
"target": "ESNext",
"isolatedModules": true,
"types": ["node"],
"paths": {
"$lib/*": ["./src/lib/*"]
}

View File

@@ -1,7 +1,7 @@
import path from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import { defineConfig } from 'vitest/config';
import { svelte } from '@sveltejs/vite-plugin-svelte';
const __dirname = path.dirname(fileURLToPath(import.meta.url));