forked from trent_larson/crowd-funder-for-time-pwa
fix: disable PWA for Capacitor builds
Updates PWA configuration to: - Disable PWA features for Capacitor builds - Add @capacitor/app dependency - Update environment variable handling in build config This prevents conflicts between PWA and native app functionality when building for mobile platforms. Technical changes: - Add isCapacitor check to PWA disable logic - Update VITE_PWA_ENABLED environment variable definition - Add @capacitor/app to package dependencies
This commit is contained in:
10
package-lock.json
generated
10
package-lock.json
generated
@@ -9,6 +9,7 @@
|
||||
"version": "0.4.4",
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^6.2.0",
|
||||
"@capacitor/app": "^6.0.0",
|
||||
"@capacitor/cli": "^6.2.0",
|
||||
"@capacitor/core": "^6.2.0",
|
||||
"@capacitor/ios": "^6.2.0",
|
||||
@@ -2599,6 +2600,15 @@
|
||||
"@capacitor/core": "^6.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/app": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/app/-/app-6.0.0.tgz",
|
||||
"integrity": "sha512-X5UGd90Jh5p9rmoPyMqFyFWqOypdJgVJhYcM5X1YyDVJJGzmJ5MuYv1+ajj5DW9Qyh+5a3th9WYptdGby8jidA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@capacitor/core": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/cli": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-6.2.0.tgz",
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^6.2.0",
|
||||
"@capacitor/app": "^6.0.0",
|
||||
"@capacitor/cli": "^6.2.0",
|
||||
"@capacitor/core": "^6.2.0",
|
||||
"@capacitor/ios": "^6.2.0",
|
||||
|
||||
4
src/main.electron.ts
Normal file
4
src/main.electron.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { initializeApp } from "./main.common";
|
||||
|
||||
const app = initializeApp();
|
||||
app.mount("#app");
|
||||
4
src/main.pywebview.ts
Normal file
4
src/main.pywebview.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { initializeApp } from "./main.common";
|
||||
|
||||
const app = initializeApp();
|
||||
app.mount("#app");
|
||||
@@ -17,7 +17,7 @@ export async function createBuildConfig(mode: string) {
|
||||
const isCapacitor = mode === "capacitor";
|
||||
const isPyWebView = mode === "pywebview";
|
||||
|
||||
if (isElectron || isPyWebView) {
|
||||
if (isElectron || isPyWebView || isCapacitor) {
|
||||
process.env.VITE_PWA_ENABLED = 'false';
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function createBuildConfig(mode: string) {
|
||||
},
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
'process.env.VITE_PWA_ENABLED': JSON.stringify(!(isElectron || isPyWebView)),
|
||||
'process.env.VITE_PWA_ENABLED': JSON.stringify(!(isElectron || isPyWebView || isCapacitor)),
|
||||
__dirname: isElectron ? JSON.stringify(process.cwd()) : '""',
|
||||
},
|
||||
resolve: {
|
||||
|
||||
Reference in New Issue
Block a user