Files

26 lines
858 B
TypeScript
Raw Permalink Normal View History

2026-04-10 19:00:21 +02:00
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'node:path';
2026-04-10 19:00:21 +02:00
// `@shade/widgets` re-exports from `@shade/sdk`, which transitively imports
// `@shade/storage-sqlite` (and therefore `bun:sqlite`). Vite externalizes
// `bun:sqlite` for browser builds, but the `import { Database } from
// 'bun:sqlite'` named-import then fails to resolve. Alias the module to an
// in-tree stub — the dashboard never executes the storage code path
// (it talks to the prekey server via `Shade.send` / `fetch`), so the stub
// is never reached at runtime.
2026-04-10 19:00:21 +02:00
export default defineConfig({
plugins: [react()],
base: '/dashboard/',
resolve: {
alias: {
'bun:sqlite': resolve(__dirname, 'src/stubs/bun-sqlite.ts'),
},
},
2026-04-10 19:00:21 +02:00
build: {
outDir: 'dist',
emptyOutDir: true,
target: 'es2022',
},
});