This is just a copy / adapted version of Official Vercel Adapter to make working with firebase function & hosting.
npm install adapter-firebase-function
// svelte.config.js
...
import firebase from 'adapter-firebase-function'
...
...
target: '#svelte',
adapter: firebase()
...
options | default |
---|---|
minify | false |
Add firebase({ minify: true })
to reduce output file size
npm run build
Minimal firebase config, auto generated if not exists
{
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"function": "ssr"
}
]
},
"functions": {
"predeploy": [],
"source": "functions",
"runtime": "nodejs12"
}
}