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

vite.config.ts

28 lines821 Bytes

1import { defineConfig, mergeConfig } from 'vitest/config'
2import { tanstackViteConfig } from '@tanstack/vite-config'
3import packageJson from './package.json'
4​
5const config = defineConfig({
6 // Build with relative paths so the ?worker import generates
7 // new URL("../assets/worker.js", import.meta.url) instead of
8 // an absolute "/assets/worker.js" path that breaks for library consumers.
9 base: `./`,
10 test: {
11 name: packageJson.name,
12 include: [`tests/**/*.test.ts`],
13 environment: `node`,
14 coverage: { enabled: true, provider: `istanbul`, include: [`src/**/*`] },
15 typecheck: {
16 enabled: true,
17 include: [`tests/**/*.test.ts`, `tests/**/*.test-d.ts`],
18 },
19 },
20})
21​
22export default mergeConfig(
23 config,
24 tanstackViteConfig({
25 entry: `./src/index.ts`,
26 srcDir: `./src`,
27 }),