forked from jsnbuchanan/crowd-funder-for-time-pwa
WIP: disabling absurd-sql when using Capacitor SQLite
This commit is contained in:
@@ -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'
|
||||
] : []
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user