Mira
735 subscribers
802 photos
25 videos
20 files
263 links
sporadic attempts at cybersec.
personal channel.

files: @mira_files
playlist: @the_coding_playlist
Download Telegram
setting up svelte + electron + tailwind on the first try is a big win
these were my scripts and deps (will probably drop the fully polished starter)
"scripts": {
"dev": "concurrently --kill-others \"vite\" \"npm run dev:electron\"",
"dev:vite": "vite",
"dev:electron": "cross-env DEV_ENV=true electron .",
"build": "vite build",
"preview": "vite preview",
"package": "npm run build && electron-forge package",
"make": "npm run build && electron-forge make"
},
"devDependencies": {
"@electron-forge/cli": "^7.6.1",
"@electron-forge/maker-deb": "^7.6.1",
"@electron-forge/maker-rpm": "^7.6.1",
"@electron-forge/maker-squirrel": "^7.6.1",
"@electron-forge/maker-zip": "^7.6.1",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/vite": "^4.0.0",
"concurrently": "^9.1.2",
"cross-env": "^7.0.3",
"electron": "^34.0.1",
"electron-reload": "2.0.0-alpha.1",
"svelte": "^5.19.5",
"tailwindcss": "^4.0.0",
"vite": "^6.0.11"
},
"dependencies": {
"electron-squirrel-startup": "^1.0.1"
}
an easy fix to ensure electron only loads the page after the vite dev server is ready (avoids that white blank page at first)
// main.js

function waitForViteServer(url, cb) {
const tryConnect = () => {
http.get(url, () => cb()).on('error', () => setTimeout(tryConnect, 300));
};
tryConnect();
}

const createWindow = () => {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
});

if (isDevEnvironment) {
waitForViteServer('http://localhost:5173', () => {
mainWindow.loadURL('http://localhost:5173/');
log('Electron running in dev mode');
});
} else {
mainWindow.loadFile(path.join(__dirname, 'build', 'index.html'));
log('Electron running in prod mode');
}
};
a twist tho, no mebrat
😁11🤯3
two greatest movies of all time
🔥10💯6
4🥰1
Mira
Photo
need #pins ?
Anonymous Poll
77%
heck yeahh
23%
nah
Mira
welp
15 votes. we subject to the majority rule (fondly remembered this from a civic class)
have a good y'all
17
this little kid came and sat with me in the church. feels great man
9😁7🤡1🤣1
the radical change this country needs ngl
😁23🤣7🔥2
people suffer from breakups.
i suffer from unmerged PRs
🤣14😁7