Search code examples
sveltesvelte-3

When creating a Svelte app from scratch, I can't find a "./public" folder after a build


Context : I wanted to try out the framework Svelte.js on a simple example.

When creating an Svelte app from scratch using:

npm create svelte@latest myapp

I can't find a ./public folder after a build. (The build operations used the command: npm run build )

Instead, the build command seems to put the generated javaScript files in a hidden folder:

.svelte-kit

However, I don't see a folder in there with an index.html file and a matching app.js file.

  • Did I miss something?
  • Am I doing something wrong?
  • Should I have provided extra options to the build command?

Solution

  • SvelteKit produces a .svelte-kit directory during the build by default, so you have not done anything wrong.

    If you are building a fully static site you can use the static adapter to generate a build directory with nothing but static files, if that was what you were expecting.