capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
335 stars 59 forks source link

Electron doesn't reflect app changes #156

Closed rgbaman closed 2 years ago

rgbaman commented 2 years ago

Describe the bug When changing/adding code, the changes aren't reflected within the app when you run npx cap open @capacitor-community/electron. I have needed to remove the electron folder and re-add it to see any changes.

To Reproduce Steps to reproduce the behavior:

  1. Run npx cap add @capacitor-community/electron to add the Electron folder,
  2. Open Electron with npx cap open @capacitor-community/electron,
  3. Go back in to IDE and make some changes,
  4. Re-open Electron with npx cap open @capacitor-community/electron.

Expected behavior The Electron app to reflect the new changes.

Desktop (please complete the following information):

rgbaman commented 2 years ago

In fact I've just managed to find a solution by running:

  1. ionic build,
  2. npx cap copy @capacitor-community/electron,
  3. npx cap open @capacitor-community/electron

I assumed it would generate the build as part of the open command as per the command line output:

ℹ Opening Electron platform: start 🚀
ℹ Opening Electron platform: builing electron app
⠴ Opening Electron platform: running electron app
IT-MikeS commented 2 years ago

Nope, this is the correct behavior just like other Capacitor platforms. The build message you are seeing for open is part of compiling the actual electron project that your web app gets copied into, it does things like plugin loading and TS -> JS of the electron project files.