···11+import adapter from '@sveltejs/adapter-auto'
22+import { vitePreprocess } from '@sveltejs/kit/vite'
33+44+/** @type {import('@sveltejs/kit').Config} */
55+const config = {
66+ // Consult https://kit.svelte.dev/docs/integrations#preprocessors
77+ // for more information about preprocessors
88+ preprocess: vitePreprocess(),
99+1010+ kit: {
1111+ // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
1212+ // If your environment is not supported or you settled on a specific environment, switch out the adapter.
1313+ // See https://kit.svelte.dev/docs/adapters for more information about adapters.
1414+ adapter: adapter(),
1515+ },
1616+}
1717+1818+export default config
+17
examples/sveltekit/tsconfig.json
···11+{
22+ "extends": "./.svelte-kit/tsconfig.json",
33+ "compilerOptions": {
44+ "allowJs": true,
55+ "checkJs": true,
66+ "esModuleInterop": true,
77+ "forceConsistentCasingInFileNames": true,
88+ "resolveJsonModule": true,
99+ "skipLibCheck": true,
1010+ "sourceMap": true,
1111+ "strict": true
1212+ }
1313+ // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
1414+ //
1515+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
1616+ // from the referenced tsconfig.json - TypeScript does not merge them in
1717+}
+6
examples/sveltekit/vite.config.ts
···11+import { sveltekit } from '@sveltejs/kit/vite'
22+import { defineConfig } from 'vitest/config'
33+44+export default defineConfig({
55+ plugins: [sveltekit()],
66+})
+1-1
test/web-worker/vitest.config.ts
···1212 ],
1313 },
1414 onConsoleLog(log) {
1515- if (log.includes('Cannot find module'))
1515+ if (log.includes('Failed to load'))
1616 return false
1717 },
1818 },
+12
examples/sveltekit/src/app.d.ts
···11+// See https://kit.svelte.dev/docs/types#app
22+// for information about these interfaces
33+declare global {
44+ namespace App {
55+ // interface Error {}
66+ // interface Locals {}
77+ // interface PageData {}
88+ // interface Platform {}
99+ }
1010+}
1111+1212+export {};
···6666 })
6767 expect(event).toBeInstanceOf(ErrorEvent)
6868 expect(event.error).toBeInstanceOf(Error)
6969- expect(event.error.message).toContain('Cannot find module')
6969+ expect(event.error.message).toContain('Failed to load')
7070})
71717272it('self injected into worker and its deps should be equal', async () => {
···11+import { describe, expect, it } from 'vitest'
22+import { add } from './add'
33+44+describe('sum test', () => {
55+ it('adds 1 + 2 to equal 3', () => {
66+ expect(add(1, 2)).toBe(3)
77+ })
88+})
+8
examples/sveltekit/src/lib/add.ts
···11+import { dev } from '$app/environment'
22+33+export function add(a: number, b: number) {
44+ if (dev)
55+ console.warn(`Adding ${a} and ${b}`)
66+77+ return a + b
88+}
+2
examples/sveltekit/src/routes/+page.svelte
···11+<h1>Welcome to SvelteKit</h1>
22+<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>