I have created a svelte app and building app using SvelteKit everything is works fine.
I tried to deploy this app in firebase hosting but it fails. Sveltekit generating production build under .svelte-kit
folder. I tried to change the public
object value to ".svelte-kit"
from firebase.json
file but it returns error like there is no index.html and 404.html. What we need to change in firebase.json
to make it work?
{
"hosting": {
"public" : "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
2
Answers
While building svelte app for production we can configure build location to public using
svelte.config.js
fileHere we should use
@sveltejs/adapter-static
adapter to build.No need to change
firebase.json
we can leave it as it isI have built an adapter for firebase which enables SSR for Firebase and supports CloudFunctions v2 for concurrency:
sveltekit-adapter-firebase