isle.pizza/src/main.js
Christian Semmler 804a87e687
Migrate frontend to Svelte 5
- Replace vanilla JS with Svelte 5 components
- Add Vite build system with Terser optimization
- Reorganize assets into src/ and public/ directories
- Update README with setup instructions
2026-01-11 19:10:16 -07:00

28 lines
700 B
JavaScript

import App from './App.svelte';
import { mount } from 'svelte';
import './app.css';
// Global Module object required by Emscripten - must be defined before isle.js loads
window.Module = {
arguments: ['--ini', '/config/isle.ini'],
running: false,
preRun: function () {
window.Module["addRunDependency"]("isle");
window.Module.running = true;
},
canvas: null, // Will be set after mount
onExit: function () {
window.location.reload();
}
};
// Mount Svelte app
const app = mount(App, {
target: document.getElementById('app')
});
// Set canvas reference after mount
window.Module.canvas = document.getElementById('canvas');
export default app;