Complete the code to initialize Firebase Hosting in your project.
firebase init [1]Use hosting to set up Firebase Hosting for your project.
Complete the code to deploy your Firebase Hosting site.
firebase deploy --only [1]Deploy only the hosting part to publish your website.
Fix the error in the Firebase Hosting configuration file to specify the public directory.
{
"hosting": {
"public": "[1]",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}The public directory is where your static files live for Firebase Hosting.
Fill both blanks to configure Firebase Hosting rewrites for a single-page app.
{
"hosting": {
"public": "[1]",
"rewrites": [
{ "source": "**", "destination": "[2]" }
]
}
}Use public as the folder and index.html as the rewrite destination for SPA routing.
Fill all three blanks to create a Firebase Hosting configuration with headers and clean URLs.
{
"hosting": {
"public": "[1]",
"headers": [
{
"source": "**/*.@(js|css)",
"headers": [
{ "key": "Cache-Control", "value": "[2]" }
]
}
],
"cleanUrls": [3]
}
}Set public as the folder, use a long cache time max-age=31536000 for JS/CSS, and enable cleanUrls with true.