LoginSignup
10
8

More than 5 years have passed since last update.

ElectronをつかってHTMLでデスクトップアプリを作る

Last updated at Posted at 2016-04-03

1.準備

Node.jsインストール

Node.jsからインストール。
MacならHomebrewでbrew install nodeなどでもよい。

Yeomanをインストール

npm install -g yo

YeomanのElectronジェネレーターをインストール

npm install -g generator-electron

Electornコマンドをインストール

npm install -g electron-prebuilt

2.プロジェクト作成

プロジェクト用のフォルダを作成し、そこで次を実行し、アプリ名などを入力する。

npm install -g generator-electron

3.開発

生成されたhtmlなどを編集する。
electronの実行方法は、README.mdに書いてあるとおり。

開発用のモジュールインストール

npm install

実行

npm start

デスクトップアプリ作成

次を実行すると、Linux, Win, Mac用のアプリがDistディレクトリ配下に作成される。

npm run build

注意点

開発しているときは問題ないが、Mac用にパッケージ化すると、コピペができないバグがある。
メニューを実装すると、コピペできるようになるので、メニューは作った方がよい。

参考
* http://qiita.com/nyamogera/items/81832dccb57054fbd406
* http://yonda1229.hatenablog.com/entry/2015/10/03/163300

10
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
8