Commit 21e99546 authored by 神楽坂玲奈's avatar 神楽坂玲奈

clean start

parent 5716be54
{
"printWidth": 140,
"singleQuote": true
}
// Modules to control application life and create native browser window // Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron') const { app, BrowserWindow } = require('electron');
const path = require('path') const path = require('path');
function createWindow () { function createWindow() {
// Create the browser window. // Create the browser window.
const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({
width: 800, width: 800,
...@@ -10,10 +10,14 @@ function createWindow () { ...@@ -10,10 +10,14 @@ function createWindow () {
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js') preload: path.join(__dirname, 'preload.js')
} }
}) });
// and load the index.html of the app. // and load the index.html of the app.
mainWindow.loadFile('dist/ci/index.html') if (process['NODE_ENV'] === 'development') {
mainWindow.loadURL('http://localhost:4200');
} else {
mainWindow.loadFile('dist/ci/index.html');
}
// Open the DevTools. // Open the DevTools.
// mainWindow.webContents.openDevTools() // mainWindow.webContents.openDevTools()
...@@ -23,21 +27,21 @@ function createWindow () { ...@@ -23,21 +27,21 @@ function createWindow () {
// initialization and is ready to create browser windows. // initialization and is ready to create browser windows.
// 部分 API 在 ready 事件触发后才能使用。 // 部分 API 在 ready 事件触发后才能使用。
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow();
app.on('activate', function () { app.on('activate', function() {
// On macOS it's common to re-create a window in the app when the // On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open. // dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow();
}) });
}) });
// Quit when all windows are closed, except on macOS. There, it's common // Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits // for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q. // explicitly with Cmd + Q.
app.on('window-all-closed', function () { app.on('window-all-closed', function() {
if (process.platform !== 'darwin') app.quit() if (process.platform !== 'darwin') app.quit();
}) });
// In this file you can include the rest of your app's specific main process // In this file you can include the rest of your app's specific main process
// code. 也可以拆分成几个文件,然后用 require 导入。 // code. 也可以拆分成几个文件,然后用 require 导入。
import { Directive } from '@angular/core';
@Directive({
selector: 'webview'
})
export class WebviewDirective {
constructor() { }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment