forked from trent_larson/crowd-funder-for-time-pwa
Split monolithic vite.config.mjs into separate config files: - vite.config.web.mts - vite.config.electron.mts - vite.config.capacitor.mts - vite.config.pywebview.mts - vite.config.common.mts - vite.config.utils.mts Updates: - Modify package.json scripts to use specific config files - Add electron-builder as dev dependency - Update electron build configuration - Fix electron resource paths - Remove old vite.config.mjs and utils.js This change improves maintainability by: - Separating concerns for different build targets - Making build configurations more explicit - Reducing complexity in individual config files
29 lines
588 B
JavaScript
29 lines
588 B
JavaScript
const { app, BrowserWindow } = require('electron');
|
|
const path = require('path');
|
|
|
|
function createWindow() {
|
|
const win = new BrowserWindow({
|
|
width: 1200,
|
|
height: 800,
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
contextIsolation: false
|
|
}
|
|
});
|
|
|
|
win.loadFile(path.join(__dirname, 'dist-electron/www/index.html'));
|
|
}
|
|
|
|
app.whenReady().then(createWindow);
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit();
|
|
}
|
|
});
|
|
|
|
app.on('activate', () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createWindow();
|
|
}
|
|
});
|