Update dependencies
This commit is contained in:
parent
3c51a1994f
commit
53c1852757
5 changed files with 2685 additions and 2628 deletions
19
package.json
19
package.json
|
@ -1,20 +1,19 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "dist/main.js",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron-webpack dev"
|
"start": "electron-webpack dev"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/gl-matrix": "^2.4.4",
|
"@types/gl-matrix": "^2.4.5",
|
||||||
"electron": "^4.0.0-beta.8",
|
"electron": "^7.1.7",
|
||||||
"electron-webpack": "^2.6.1",
|
"electron-webpack": "^2.7.4",
|
||||||
"electron-webpack-ts": "^3.1.0",
|
"electron-webpack-ts": "^3.2.0",
|
||||||
"raw-loader": "^0.5.1",
|
"raw-loader": "^4.0.0",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.20.1",
|
||||||
"typescript": "^3.2.2",
|
"typescript": "^3.7.4",
|
||||||
"webpack": "^4.27.1"
|
"webpack": "^4.41.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gl-matrix": "^2.8.1"
|
"gl-matrix": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { format as formatUrl } from 'url';
|
||||||
|
|
||||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||||
|
|
||||||
|
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
||||||
let mainWindow: BrowserWindow|null = null;
|
let mainWindow: BrowserWindow|null = null;
|
||||||
|
|
||||||
function getIndexURL(): string {
|
function getIndexURL(): string {
|
||||||
|
@ -18,7 +19,7 @@ function getIndexURL(): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMainWindow(): BrowserWindow {
|
function createMainWindow(): BrowserWindow {
|
||||||
const window = new BrowserWindow();
|
const window = new BrowserWindow({webPreferences: {nodeIntegration: true}});
|
||||||
|
|
||||||
if (isDevelopment)
|
if (isDevelopment)
|
||||||
window.webContents.openDevTools();
|
window.webContents.openDevTools();
|
||||||
|
@ -31,21 +32,25 @@ function createMainWindow(): BrowserWindow {
|
||||||
|
|
||||||
window.webContents.on('devtools-opened', () => {
|
window.webContents.on('devtools-opened', () => {
|
||||||
window.webContents.focus();
|
window.webContents.focus();
|
||||||
});
|
})
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// quit application when all windows are closed
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
// on macOS it is common for applications to stay open until the user explicitly quits
|
||||||
if (process.platform !== 'darwin')
|
if (process.platform !== 'darwin')
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
|
// on macOS it is common to re-create a window even after all windows have been closed
|
||||||
if (!mainWindow)
|
if (!mainWindow)
|
||||||
mainWindow = createMainWindow();
|
mainWindow = createMainWindow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// create main BrowserWindow when electron is ready
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
mainWindow = createMainWindow();
|
mainWindow = createMainWindow();
|
||||||
});
|
});
|
||||||
|
|
|
@ -89,9 +89,7 @@ export class Renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private mkContext(): WebGLRenderingContext {
|
private mkContext(): WebGLRenderingContext {
|
||||||
const gl = (
|
const gl = this.canvas.getContext('webgl');
|
||||||
this.canvas.getContext('webgl') || this.canvas.getContext('experimental-webgl')
|
|
||||||
);
|
|
||||||
if (!gl)
|
if (!gl)
|
||||||
throw new Error('unable to initialize WebGL context');
|
throw new Error('unable to initialize WebGL context');
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{ test: /\.(vs|fs)$/, use: ['raw-loader'] },
|
||||||
test: /\.(vs|fs)$/,
|
],
|
||||||
use: [
|
},
|
||||||
'raw-loader'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue