0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

electron 最小構成

0
Posted at

electron install

yarn init -y 
yarn add -D electron 

index.js

index.js
const { app, BrowserWindow } = require('electron')

let window

app.on('ready', () => {
    window = new BrowserWindow({
        width: 500,
        height: 500,
        useContentSize: true
    })

    window.loadFile('index.html')

    window.on('closed', () => {
        window = null
    })
})

app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') {
        app.quit()
    }
})

index.html

index.html
<!DOCTYPE html>
<body>
    <div>
        hello, world
    </div>
</body>

起動

yarn electron .

結果

スクリーンショット 2020-12-29 0.07.11.png

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?