-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
38 lines (29 loc) · 833 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { app, BrowserWindow } from 'electron'
import * as path from 'path'
import * as url from 'url'
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
let win: BrowserWindow
function createWindow() {
win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL(
url.format({
pathname: path.join(__dirname, `src/index.html`),
protocol: 'file:',
slashes: true,
})
)
app.on('ready', createWindow)
app.on('activate', () => {
if (win === null) {
createWindow()
}
})
}