Improve application responsiveness and background processing
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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' }
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user