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 .
