refactor(example): use tsconfig and change entries to ts (#3575)

This commit is contained in:
Tony
2026-09-09 19:31:52 +08:00
committed by GitHub
parent b48d52cf6e
commit 2a5783397e
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -12,6 +12,6 @@
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
@@ -8,7 +8,7 @@ import App from './App.svelte'
import { mount } from 'svelte'
const app = mount(App, {
target: document.querySelector('#app')
target: document.querySelector('#app')!
})
export default app
@@ -3,6 +3,7 @@
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext",
"noEmit": true,
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
@@ -22,11 +23,12 @@
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
"checkJs": true,
"types": ["vite/client", "svelte"]
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
}