#Create a desktop app using Deno + Svelte

1 messages · Page 1 of 1 (latest)

thick holly
#

you can still serve files through the server

#

just redirect .show(bufferText) to .navigate(url)

thick holly
#

more concrete example:

craggy narwhal
# thick holly 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 :/

craggy narwhal
#

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...

thick holly
#

Cool. I tried helping. Use Tauri then.

craggy narwhal
thick holly
#

Electron won't compile with Deno...

#

You can literally try compiling everything yourself...

craggy narwhal
#

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...

thick holly
#

No, I understand... And I gave you a way to use it with Deno...

craggy narwhal
#

...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...

thick holly
craggy narwhal
thick holly
#

They downloaded it?

craggy narwhal
#

either i needed to open port or host the app..

thick holly
#

What? The user hosts the local server....

craggy narwhal
#

bro

#

this is not a app to be used only on my pc

thick holly
#

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.

craggy narwhal
#

on creating the executable it needs to get the files on the dist serve them and then open in the view

thick holly
#

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

craggy narwhal
#

i failed to see how to compile that

#

and create a standalone app

#

sure when i do deno task dev that will open a webview with the project