capacitor-community / capacitor-community/electron

Consider support for the `server` block from `capacitor.config`

Open
#120 3 comments 4 reactions 0 assignees View on GitHub
feature request
Dominant language
TypeScript
Stars
398
Forks
63
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I have seen that support for "Livereload for Ionic React app" (#50), however, I wonder if it'd be possible to support the `server` block from `capacitor.config` in the same way that it is used for android and ios.

**Describe the solution you'd like**
Access would be required to all of `capacitor.config` (currently only the electron bit is in `CapacitorFileConfig`), and then something like:

```
private async loadMainWindow(thisRef: any) {
if (electronIsDev && config.server) {
await thisRef.MainWindow.loadURL(config.server.url);
} else {
await thisRef.loadWebApp(thisRef.MainWindow);
}
}
```

**Describe alternatives you've considered**
The existing solution (#50) works for reloading when the backend changes, but this would mean you don't have to wait for a complete build.

**Additional context**
N/A

Contributor guide

Open the contributing guide

Research direction

Start by tracing CapacitorFileConfig and the loadMainWindow method, then review the existing Livereload work in issue #50. Check how capacitor.config is currently exposed to the Electron platform and how the main window loads the web app. Done means the server block, including server.url, is available in development while the existing loading path remains for other cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.