Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

vite.config.ts

41 lines995 Bytes

1import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2import { svelteTesting } from '@testing-library/svelte/vite'
3import { defineConfig } from 'vitest/config'
4import packageJson from './package.json'
5​
6export default defineConfig({
7 plugins: [
8 svelte({
9 preprocess: vitePreprocess(),
10 compilerOptions: {
11 runes: true,
12 },
13 }),
14 svelteTesting(),
15 ],
16 // fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
17 resolve: {
18 conditions: ['@tanstack/custom-condition'],
19 },
20 environments: {
21 ssr: {
22 resolve: {
23 conditions: ['@tanstack/custom-condition'],
24 },
25 },
26 },
27 test: {
28 name: packageJson.name,
29 dir: './tests',
30 watch: false,
31 environment: 'jsdom',
32 setupFiles: ['./tests/test-setup.ts'],
33 coverage: {
34 enabled: !!process.env.CI,
35 provider: 'istanbul',
36 include: ['src/**/*'],
37 },
38 typecheck: { enabled: true },
39 restoreMocks: true,
40 },
41})