Updating Your Capacitor Electron Project
Occasionally, you'll need to make Capacitor updates to your Electron app, including new ways of interfacing with Capacitor inside of your Electron codebase.
To update the version of @capacitor/electron used in your app, just npm install latest version from inside electron folder:
cd electron npm install @capacitor/electron@latest
To update the base structure of your Electron project, view the electron-template project in the Capacitor repo, under the tag corresponding to the latest stable release of Capacitor. The core project is kept simple on purpose: it shouldn't take much time to see what is different from the core project and your project.
index.jsto not use
injectCapacitorfunction as it's now deprecated and will be removed on 2.0.0. It also fixes problems when using electron 5. See example
- Create a
electronfolder with this content
^1.1.0as on the template