Commit 5fcbc9e7 authored by Théophile BORNON's avatar Théophile BORNON

forget electron atm

parent 5f847624
{ {
"name": "formgenerator", "name": "formgenerator",
"version": "0.1.0", "version": "0.1.0",
"main": "public/electron.js",
"homepage": "./",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@material-ui/core": "^4.2.0", "@material-ui/core": "^4.2.0",
...@@ -17,11 +15,7 @@ ...@@ -17,11 +15,7 @@
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject", "eject": "react-scripts eject"
"electron-dev": "concurrently \"yarn start\" \"wait-on http://localhost:3000 && electron .\"",
"postinstall": "electron-builder install-app-deps",
"preelectron-pack": "yarn build",
"electron-pack": "electron-builder"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
...@@ -38,24 +32,8 @@ ...@@ -38,24 +32,8 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"devDependencies": {
"concurrently": "^4.1.1",
"electron": "^5.0.6",
"electron-builder": "^21.0.15",
"typescript": "^3.5.3",
"wait-on": "^3.3.0"
},
"author": { "author": {
"name": "Théophile BORNON", "name": "Théophile BORNON",
"email": "theophile.bornon@protonmail.com" "email": "theophile.bornon@protonmail.com"
},
"build": {
"appId": "com.devinci.forgenerator",
"productName": "Form Generator",
"copyright": "Copyright © 2019 ${author}",
"files": [
"build/**/*",
"node_modules/**/*"
]
} }
} }
\ No newline at end of file
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const path = require('path');
const isDev = require('electron-is-dev');
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({width: 1920, height: 1080});
mainWindow.removeMenu();
mainWindow.maximize();
mainWindow.setTitle("Générateur de questionnaires");
mainWindow.loadURL(isDev ? 'http://localhost:3000' : `file://${path.join(__dirname, '../build/index.html')}`);
if (isDev) {
// Open the DevTools.
//BrowserWindow.addDevToolsExtension('<location to your react chrome extension>');
mainWindow.webContents.openDevTools();
}
mainWindow.on('closed', () => mainWindow = null);
}
app.on('ready', createWindow);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (mainWindow === null) {
createWindow();
}
});
\ No newline at end of file
This diff is collapsed.
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