for those of you who have the same problem, i now solved it.
You will have to install some dependecies: npm install -D @rollup/plugin-typescript svelte-preprocess @tsconfig/svelte/tsconfig.json
You then want to create a tsconfig.json file which extends the @tsconfig/svelte config fill
{
"extends": "@tsconfig/svelte/tsconfig.json",
"include": ["resources/**/*"],
"exclude": ["node_modules/*"]
}
Now you just have to change the vite.config.js file and include both typescript ans sveltePreprocess and you're good to go
import './resources/css/app.css'
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import { svelte } from '@sveltejs/vite-plugin-svelte'
import typescript from '@rollup/plugin-typescript'
import sveltePreprocess from 'svelte-preprocess'
export default defineConfig({
plugins: [
laravel.default({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
svelte({
preprocess: sveltePreprocess()
}),
typescript({
tsconfig: './tsconfig.json'
})
],
});