Skip to content

Commit

Permalink
chore: improve way native server url provided
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Feb 23, 2024
1 parent 705d3f9 commit b74c403
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions apps/picsa-apps/extension-app-native/.env.serve
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SERVER_URL=http://0.0.0.0:4200
3 changes: 2 additions & 1 deletion apps/picsa-apps/extension-app-native/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
resources/android
.idea
.idea
*.local
14 changes: 8 additions & 6 deletions apps/picsa-apps/extension-app-native/capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ const config: CapacitorConfig = {
// },
// },
server: {
/**
* Uncomment and replace with local ip to serve live-reload
* See notes at https://docs.picsa.app/advanced/testing
**/

// url: 'http://192.168.50.67:4200',
androidScheme: 'http',

/**
Expand All @@ -56,4 +50,12 @@ const config: CapacitorConfig = {
},
};

/**
* Additional configuration used to support live-reloading the app from a dev server
* See notes at https://docs.picsa.app/advanced/testing
**/
if (process.env.SERVER_URL) {
config.server = { ...config.server, url: process.env.SERVER_URL };
}

export default config;
7 changes: 5 additions & 2 deletions apps/picsa-apps/extension-app-native/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
},
"serve": {
"executor": "nx:run-commands",
"description": "Serve extension app in external mode to connect. NOTE - need to update capacitor.config.ts before build",
"description": "Serve extension app in external mode to support live-reload",
"dependsOn": ["build"],
"options": {
"commands": ["nx run picsa-apps-extension-app:serve --configuration=external"]
"commands": ["npx cap sync", "nx run picsa-apps-extension-app:serve --configuration=external"],
"cwd": "apps/picsa-apps/extension-app-native",
"parallel": false
}
},

"resources": {
"executor": "nx:run-commands",
"description": "Populate splash and icon from resources files. NOTE - may have to run manually from directory",
Expand Down

0 comments on commit b74c403

Please sign in to comment.