Open History to see the last commit
1import { dirname, resolve } from 'node:path'
2import { fileURLToPath } from 'node:url'
3import { defineConfig } from 'vite'
4
5const packageDirectory = dirname(fileURLToPath(import.meta.url))
6
7export default defineConfig({
8 base: `./`,
9 // wa-sqlite locates its sibling WASM file through import.meta.url. Keeping
10 // the module out of Vite's dependency prebundle preserves that relationship
11 // for this real-browser fixture.
12 optimizeDeps: {
13 exclude: [`@journeyapps/wa-sqlite`],
14 },
15 resolve: {
16 alias: {
17 '@tanstack/db': resolve(packageDirectory, `../db/src`),
18 '@tanstack/db-ivm': resolve(packageDirectory, `../db-ivm/src`),
19 '@tanstack/db-sqlite-persistence-core': resolve(
20 packageDirectory,
21 `../db-sqlite-persistence-core/src`,
22 ),
23 '@tanstack/query-db-collection': resolve(
24 packageDirectory,
25 `../query-db-collection/src`,
26 ),
27 },
28 },
29 server: {
30 proxy: {
31 '/electric': {
32 target: process.env.ELECTRIC_URL ?? `http://127.0.0.1:3000`,
33 changeOrigin: true,
34 rewrite: (path) => path.replace(/^\/electric/, ``),
35 },
36 },
37 fs: {
38 allow: [resolve(packageDirectory, `../..`)],
39 },
40 },
41})