#Create a desktop app using Deno + Svelte
1 messages · Page 1 of 1 (latest)
you can still serve files through the server
just redirect .show(bufferText) to .navigate(url)
more concrete example:
this im able to do yes... but its not what i want... i dont want to serve the project on my pc and have an app with a remote url..
I want a standalone app that can serve this files by itself :/
the point its to compile this and anyone can run the executable and see the website on the webview as an app... without hosting it...
Cool. I tried helping. Use Tauri then.
thx for ur help... but i had told you I had a setup running with electron already and was trying to migrate to deno...
Electron won't compile with Deno...
You can literally try compiling everything yourself...
ur not understanding what Im saying... I have a project with sveltekit (on node) and electron and everything is working fine...
I saw that deno can compile and make executables/standalone apps and wanted to migrate my project to here... What im trying to do its to create a standalone app with svelte/sveltekit using deno...
No, I understand... And I gave you a way to use it with Deno...
...yeah sure.. hosting my svelte app and then doing a navigate to a public url... thats not what I want...
- But now the big question.. how can I create a webview app using the /dist generated after deno run build?
i want to use the files as I mentioned on the description of this post...
probably I need to create a handler to be served and then use the navigation... but the handler part is the hard one to understand...
It would be a local private URL.
how would i share the standalone app then to another pc???
They downloaded it?
either i needed to open port or host the app..
What? The user hosts the local server....
Okay. It seems you don't understand what I am saying fundamentally.
WebUI can communicate and dynamically update by navigating to localhost. This localhost is where the svelte server is served. Combine those two things, create an executable. Users to download the project anywhere. When they launch the executable it'll start the server and the webUI.
Alternatively, compile svelte, serve the files directly to WebUI, not sure this will be dynamic enough. Done.
yeah thats what im trying to do.... but im not finding a way to start a server with the files and serve it on the webUI................
and ur solution is serving it manually on ur pc using deno task dev or serve or whatever and putting the ip manually on the webview.ts u have...
on creating the executable it needs to get the files on the dist serve them and then open in the view
Good luck m8
import { defineConfig } from "vite";
import deno from "@deno/vite-plugin";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { WebUI } from "https://deno.land/x/[email protected]/mod.ts";
// https://vite.dev/config/
export default defineConfig({
plugins: [deno(), svelte()],
server: {
port: 5173,
},
});
// Launch WebUI after the server starts
(async () => {
const myWindow = new WebUI();
myWindow.show('<html><script src="webui.js"></script> Hello World! </html>');
myWindow.navigate("http://localhost:5173/");
await WebUI.wait();
})();
I'm still "manually" serving the url