18 lines
709 B
TypeScript
18 lines
709 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'node:path';
|
|
|
|
// Build the same report implementations for Node workers. Their database is
|
|
// read-only; migrations and all application writes stay in the controller.
|
|
export default defineConfig({
|
|
plugins: [{ name: 'report-database', enforce: 'pre', resolveId(source) {
|
|
if (source.endsWith('/db/index.js')) return resolve('src/lib/server/reports/database.ts');
|
|
} }],
|
|
build: {
|
|
ssr: true, outDir: '.svelte-kit/reports', emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: 'src/lib/server/reports/worker.ts', external: ['better-sqlite3'],
|
|
output: { entryFileNames: 'worker.mjs' }
|
|
}
|
|
}
|
|
});
|