WIP: disabling absurd-sql when using Capacitor SQLite

This commit is contained in:
Matthew Raymer
2025-05-27 13:15:41 +00:00
parent 7b4f9d6556
commit f0d8fdf98c
5 changed files with 151 additions and 33 deletions

View File

@@ -17,8 +17,10 @@ export async function createBuildConfig(mode: string): Promise<UserConfig> {
const isCapacitor = mode === "capacitor";
const isPyWebView = mode === "pywebview";
// Explicitly set platform
// Explicitly set platform and disable PWA for Electron
process.env.VITE_PLATFORM = mode;
process.env.VITE_PWA_ENABLED = isElectron ? 'false' : 'true';
process.env.VITE_DISABLE_PWA = isElectron ? 'true' : 'false';
if (isElectron || isPyWebView || isCapacitor) {
process.env.VITE_PWA_ENABLED = 'false';
@@ -55,7 +57,8 @@ export async function createBuildConfig(mode: string): Promise<UserConfig> {
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.VITE_PLATFORM': JSON.stringify(mode),
'process.env.VITE_PWA_ENABLED': JSON.stringify(!(isElectron || isPyWebView || isCapacitor)),
'process.env.VITE_PWA_ENABLED': JSON.stringify(!isElectron),
'process.env.VITE_DISABLE_PWA': JSON.stringify(isElectron),
__dirname: isElectron ? JSON.stringify(process.cwd()) : '""',
__IS_MOBILE__: JSON.stringify(isCapacitor),
__USE_QR_READER__: JSON.stringify(!isCapacitor),
@@ -97,7 +100,9 @@ export async function createBuildConfig(mode: string): Promise<UserConfig> {
'register-service-worker',
'workbox-window',
'web-push',
'serviceworker-webpack-plugin'
'serviceworker-webpack-plugin',
'vite-plugin-pwa',
'@vite-pwa/vue'
] : []
}
};