superstatic always loads configs from existing `firebase.json` file on project root
维护者通常 5 天内回复
@jabrailkhalil 已经在做这个了。
开始于 2026年10月3日。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- firebase, javascript
- 领域
- backend
调研方向
从 index.js 复现开始,在项目根目录存在 firebase.json 时,使用提供的配置跟踪 superstatic.server 的启动过程。比较有无 firebase.json 时产生的标头,然后添加覆盖测试,证明显式配置不会被意外覆盖;当复现情况下仅由 firebase.json 提供的标头不存在时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Would it be possible to prevent superstatic from automatically loading hosting configs from firebase.json?
When I run a code like
index.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
{
"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
- 主要语言
- TypeScript
- 星标
- 1.1k
- 派生
- 90
- 平均合并
- 3 天 19 小时
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/superstatic 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
firebase/superstatic#622 ·
维护者通常 5 天内回复
-
难度 3/5 1-2 天 新手友好度 65/100
firebase/superstatic#573 · 2 条评论 ·
维护者通常 5 天内回复
-
Redirect inserting unexpected slash between index and parameters可能已有人在做 @sean0407 于 28 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
firebase/superstatic#300 ·
维护者通常 5 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
firebase/superstatic#286 ·
维护者通常 5 天内回复
-
难度 4/5 3-5 天 新手友好度 32/100
firebase/superstatic#277 · 4 个 reaction ·
维护者通常 5 天内回复
查看 firebase/superstatic 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
vercel-labs/ui#865 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 63/100
outline/outline#14638 · 1 条评论 ·
维护者通常 1 天内回复
-
wayfinder:grilling
难度 2/5 1-3 小时 新手友好度 72/100
patricktree/cup#484 ·
-
bot:ai-assisted component:platform-js status:untriaged
难度 2/5 1-3 小时 新手友好度 78/100
midnightntwrk/platform-js#69 ·
维护者通常 1 天内回复