Started testing Electron
This commit is contained in:
parent
11cd8708d9
commit
bf74527b47
2 changed files with 18 additions and 1 deletions
15
src/app.js
Normal file
15
src/app.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
const electron = require('electron')
|
||||
const app = electron.app
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
|
||||
let url
|
||||
if (process.env.NODE_ENV === 'DEV') {
|
||||
url = 'http://localhost:8080/'
|
||||
} else {
|
||||
url = `file://${process.cwd()}/dist/index.html`
|
||||
}
|
||||
|
||||
app.on('ready', () => {
|
||||
let window = new BrowserWindow({width: 800, height: 600})
|
||||
window.loadURL(url)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue