How to output my SvelteKit app in index.html when I run `npm run build`

Viewed 18

I am building a simple sveltekit application. Is working as expected on the development server but I am not getting the expected output when I run npm run build. Here is the setup:

  • I am using the @sveltejs/adapter-static adapter.
  • I am setting export const ssr = false; in +layout.js
  • I am setting fallback: "index.html" in svelte.config.js

The problem is the index.html it outputs is just the basic 'Welcome to SvelteKit' page and not my application that I see when I run the development server.

I just need to run a simple SPA and I don't care for SSR but I do need the routing in sveltekit. I am also wondering the purposes of the fallback page and I can't see any documentation on how it can be customized.

I feel like any SPA outputting its app in an index.html is the basic and wondering why it is so hard.

0 Answers
Related