Search code examples
firebasesveltefirebase-hostingsvelte-3sveltekit

Sveltekit Firebase hosting


How can I use SvelteKit and firebase hosting? firebase hosting requires the html file to be called Index.html while SvelteKit calls it app.html. I think it has something to do with SvelteKit adaptors


Solution

  • You can configure Firebase to serve the file you want.

    "hosting": {
      // ...
    
      // Serves app.html for requests to files or directories that do not exist
      "rewrites": [ {
        "source": "**",
        "destination": "/app.html"
      } ]
    }