All skills
firebase avatar

/firebase-hosting-basics

@073edf7 official
by firebasefirebase/agent-skills461 stars
102

Deploys and configures classic Firebase Hosting for static websites, single-page apps (SPAs), and microservices. Use when deploying static sites/SPAs, setting up custom domains, configuring firebase.json hosting settings (redirects, rewrites, headers, multi-site), or managing preview channels. Don't use for Firebase App Hosting (Next.js/SSR), Auth, Firestore queries/rules, Data Connect, or Crashlytics.

Use this Skill: https://skilld.dev/gh/firebase/agent-skills/firebase-hosting-basics

This session only. Nothing lands on disk.

referencesconfiguration.md

≈458 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Hosting Configuration (firebase.json)

The hosting section of firebase.json configures how your site is deployed and served.

Key Attributes

public (Required)

Specifies the directory to deploy to Firebase Hosting.

"hosting": {
  "public": "public"
}

ignore (Optional)

Files to ignore on deploy. Uses glob patterns (like .gitignore). Default ignores: firebase.json, **/.*, **/node_modules/**

redirects (Optional)

URL redirects to prevent broken links or shorten URLs.

"redirects": [
  {
    "source": "/foo",
    "destination": "/bar",
    "type": 301
  }
]

rewrites (Optional)

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"
    }
  }
]

headers (Optional)

Custom response headers.

"headers": [
  {
    "source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
    "headers": [
      {
        "key": "Access-Control-Allow-Origin",
        "value": "*"
      }
    ]
  }
]

cleanUrls (Optional)

If true, drops .html extension from URLs.

"cleanUrls": true

trailingSlash (Optional)

Controls trailing slashes in static content URLs.

  • true: Adds trailing slash.
  • false: Removes trailing slash.

Full Example

{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],
    "cleanUrls": true,
    "trailingSlash": false
  }
}

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides standard instructions and commands for deploying and configuring Firebase Hosting using the official Firebase CLI tool. No security vulnerabilities or malicious patterns were identified.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer6mo

    2/3 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 073edf7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 months ago
metadata
{
  "category": "Serverless"
}

README badge

README badge for firebase/agent-skills/firebase-hosting-basics