firebase / firebase/superstatic

superstatic always loads configs from existing `firebase.json` file on project root

Open
#503 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
88
Avg merge
17h 43m
Merged PRs (30d)
2

Description

Would it be possible to prevent superstatic from automatically loading hosting configs from `firebase.json`?

When I run a code like

index.js

```js
const superstatic = require('superstatic');

const options = {
host: "127.0.0.1",
port: 5004,
}

const config = {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"site": "demo-project"
}

const server = superstatic.server({
debug: false,
port: options.port,
hostname: options.host,
config: config,
compression: true,
cwd: process.cwd() || undefined,
}).listen(() => {
const siteName = config.target || config.site;
const label = siteName ? "hosting[" + siteName + "]" : "hosting";
if (config.public && config.public !== ".") {
console.log("BULLET", label, "Serving hosting files from: " + config.public);
}
console.log("SUCCESS", label, "Local server: " + "http://" + options.host + ":" + options.port);
});

server.on("error", (err) => {
console.log("DEBUG", `Error from superstatic server: ${err.stack || ""}`);
throw new Error(`An error occurred while starting the hosting development server:\n\n${err.message}`);
});
```

with a `firebase.json` file on project directory

firebase.json

```json
{
"hosting": {
"public": "public",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{
"source": "/",
"headers": [
{
"key": "header-in-firebase-json",
"value": "ehhhhhhhhhhhhh?????"
}
]
}
]
}
}
```

Running `curl -I http://127.0.0.1:5004` will output a `header-in-firebase-json`(only specified in `firebase.json`) in the response headers even though I did not specify is in the config(`index.js`)
```
$ curl -I http://127.0.0.1:5004
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 234
ETag: a3b67dafcd419de50643d682c2fb2e15
Last-Modified: Thu, 22 Jan 2026 12:59:07 GMT
Vary: Accept-Encoding
header-in-firebase-json: ehhhhhhhhhhhhh?????
Date: Thu, 22 Jan 2026 13:07:54 GMT
Connection: keep-alive
Keep-Alive: timeout=5
```

mcve - https://github.com/aalej/superstatic-503
related to - https://github.com/firebase/firebase-tools/issues/9773

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.