fix: resolve PWA build issues with SQL.js worker files

- Update worker format to ESM in Vite config to fix IIFE format error

- Increase PWA precache file size limit to 10MB to accommodate SQL.js files

- Fix type declarations for worker configuration

- Add proper type annotations for Vite config

- Add type declarations for absurd-sql module
This commit is contained in:
Matthew Raymer
2025-05-27 06:54:29 +00:00
parent 4c1b4fe651
commit 81d4f0c762
7 changed files with 116 additions and 23 deletions

16
src/types/absurd-sql.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
declare module 'absurd-sql/dist/indexeddb-main-thread' {
export interface SQLiteOptions {
filename?: string;
autoLoad?: boolean;
debug?: boolean;
}
export interface SQLiteDatabase {
exec: (sql: string, params?: any[]) => Promise<any>;
close: () => Promise<void>;
}
export function initSqlJs(options?: any): Promise<any>;
export function createDatabase(options?: SQLiteOptions): Promise<SQLiteDatabase>;
export function openDatabase(options?: SQLiteOptions): Promise<SQLiteDatabase>;
}