How to set up SvelteKit?

Firstly - thanks so much for a wonderful node-RED plugin.

I got the example Svelte project up and running no problem.

We will need SvelteKit in our case - what is the best method to get this up and running in UI builder? I've tried creating the project but the only way it seemed to work was to use a static site to get the index.html. Any help would be much appreciated, thanks!

I've not used SvelteKit but I think it is a tool to create Svelte web apps? As such, it will create the front-end code in its own folder structure.

The trick, then, to getting that to work with UIBUILDER is to either configure SvelteKit to create the content in the existing UIBUILDER instance folder or let it create it where it wants and then use a filing system link to replace the UIBUILDER folder with the linked folder.

Either way, you may need to add back in some of the things that UIBUILDER expects to have in its instance folder.

You should probably do this without Node-RED running.

As you are using svelte, you will also need to configure the build step. This is described in the docs.

Then, after you've restarted Node-RED, you will need to adjust the "Serve" setting on the advanced tab to point to the folder your build step is outputting to:

Thanks for the reply Justin. The problem is that SvelteKit doesn't create any sort of build folder when it's running in dev mode. Unless it's set to static.

I will keep having a dig but thinking we might not need to use UIBUILDER if we can get web sockets to work.

Can I suggest that you run the Svelte example first. Create a test node using it and follow the instructions to get it up and running. Hopefully it will show you the way. I don't use Svelte much and I've never used SvelteKit as I haven't needed to but there should be a way to get it going. Maybe the rollup config included in the example will give some clues. I know that when I've used that example to build something with Svelte, the Svelte dev output seems to work just fine.

Oh, and if you can get it to work, please let me know how and I will update the documentation accordingly.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.