Setting the file. One moment.
Chapter 09 · Firebase Hosting Basics
Subchapter 9.1
references/configuration.mdMarkdown2 KBView on GitHub
firebase.json)The hosting section of firebase.json configures how your site is deployed
and served.
Specifies the directory to deploy to Firebase Hosting.
"hosting": {
"public": "public"
}Files to ignore on deploy. Uses glob patterns (like .gitignore). Default
ignores: firebase.json, **/.*, **/node_modules/**
URL redirects to prevent broken links or shorten URLs.
"redirects": [
{
"source": "/foo",
"destination": "/bar",
"type": 301
}
]Serve the same content for multiple URLs, useful for SPAs or Dynamic Content.
"rewrites": [
{
"source": "**",
"destination": "/index.html"
},
{
"source": "/api/**",
"function": "apiFunction"
},
{
"source": "/container/**",
"run": {
"serviceId": "helloworld",
"region": "us-central1"
}
}
]Custom response headers.
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
]If true, drops .html extension from URLs.
"cleanUrls": trueControls trailing slashes in static content URLs.
true: Adds trailing slash.false: Removes trailing slash.{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"cleanUrls": true,
"trailingSlash": false
}
}