Calculatrice 3D & Composées
Voici les deux petits fichiers que tu places à côté de ton fichier HTML (`index.html`) pour que ton application devienne un logiciel de bureau natif exécutable :
const { app, BrowserWindow } = require('electron')
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 1024,
height: 768,
icon: path.join(__dirname, 'icon.png'),
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})
{
"name": "calel-desktop",
"version": "1.0.0",
"description": "Calculatrice 3D Electron",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "^28.0.0"
}
}