Fix Biome System integration, memory optimization, and Tiled live sync workflow
This commit is contained in:
18
main.js
18
main.js
@@ -1,8 +1,23 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
let mainWindow;
|
||||
|
||||
// 🔄 AUTO-RELOAD FOR DEVELOPMENT
|
||||
function setupAutoReload(win) {
|
||||
const watcher = fs.watch(path.join(__dirname), { recursive: true }, (eventType, filename) => {
|
||||
if (filename && (filename.endsWith('.js') || filename.endsWith('.html') || filename.endsWith('.css') || filename.endsWith('.json'))) {
|
||||
console.log(`🔄 File changed: ${filename} - Reloading...`);
|
||||
win.reload();
|
||||
}
|
||||
});
|
||||
|
||||
win.on('closed', () => {
|
||||
watcher.close();
|
||||
});
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1280,
|
||||
@@ -17,6 +32,9 @@ function createWindow() {
|
||||
|
||||
mainWindow.loadFile('index.html');
|
||||
|
||||
// 🔄 Enable Auto Reload
|
||||
setupAutoReload(mainWindow);
|
||||
|
||||
// Odpri DevTools (za development)
|
||||
mainWindow.webContents.openDevTools();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user