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

vite.config.ts

37 lines968 Bytes

1import { defineConfig } from 'vitest/config'
2​
3import packageJson from './package.json'
4​
5const config = defineConfig({
6 // fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
7 resolve: {
8 conditions: ['@tanstack/custom-condition'],
9 },
10 environments: {
11 ssr: {
12 resolve: {
13 conditions: ['@tanstack/custom-condition'],
14 },
15 },
16 },
17 test: {
18 name: packageJson.name,
19 dir: './src',
20 watch: false,
21 globals: true,
22 // The first test run by a type-checked RuleTester (project: true) builds
23 // the full TS program for the ts-fixture, which can exceed vitest's 5s
24 // default under CI load when other Nx tasks share the runner.
25 testTimeout: 15_000,
26 coverage: {
27 enabled: !!process.env.CI,
28 provider: 'istanbul',
29 include: ['src/**/*'],
30 exclude: ['src/__tests__/**'],
31 },
32 typecheck: { enabled: true },
33 restoreMocks: true,
34 },
35})
36​
37export default config