ElectronアプリをCapacitorでつくる

Capacitorは、HTML、JavaScript、およびCSSを使用してデスクトップアプリケーションを構築するために使用される一般的なツールであるElectronを、予備サポートしています。

Electronを使えば、Windows、Mac、Linux上でキャパシターアプリをネイティブに実行できます。

ElectronのCapacitorサポートは現在プレビュー段階で、iOS、Android、Webからは遅れています。

Getting Started

After creating a new Capacitor app, add the electron platform:

npx cap add electron

This will generate a new Electron project in the electron/ folder in the root of your app.

Preparing 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.

Running your App

To run your app, use

npx cap open electron

This will launch an Electron instance running your app.

Plugin Support

Electron supports any plugin with a Web implementation, as well as a few plugins with custom Electron support (such as Filesystem).

We will have more info on building Electron plugins soon.

Where to go next

That's pretty much all you need to know to build an Electron app with Capacitor!

Follow the Development Workflow guide to continue building and testing your app.

Contributors

BackNext