Building Electron Apps with Capacitor
With Electron, Capacitor apps can run natively on Windows, Mac, and Linux.
Electron support for Capacitor is currently in preview, and lags behind iOS, Android, and Web support.
After creating a new Capacitor app, add the
npx cap add electron
This will generate a new Electron project in the
electron/ folder in the root of your app.
Just like the other Capacitor platforms, the
copy command must be run periodically to sync web content with Electron:
npx cap copy
Run this after making any modifications to your web app.
To run your app, use
npx cap open electron
This will launch an Electron instance running your app.
Electron supports any plugin with a Web implementation, as well as a few plugins with custom Electron support (such as
We will have more info on building Electron plugins soon.
That's pretty much all you need to know to build an Electron app with Capacitor!