[REQUIRED] Environment info
firebase-tools: 15.2.1
Platform: Ubuntu
[REQUIRED] Test case
I want to have cache headers when deployed to live, but not on dev.
So I've made a firebase.dev.json which is a copy of firebase.json, but without the hosting.headers section.
However, when running firebase emulators:start --config ./firebase.dev.json it also seems to load the firebase.json because requests are returning the configured headers.
I've verified this by adding the following header
{
"source": "/",
"headers": [
{
"key": "WTF",
"value": "is going on?"
}
]
}
to hosting.headers in firebase.json, rebooting the emulators and this header appears (so its not browser caching or anything else mad, its genuinely coming from the firebase.json.
So then I made the assumption that it must merge firebase.json with whatever your provide to --config despite this being undocumented.
So i make a base firebase.json, then firebase.dev.json is just {} and firebase.prod.json just has {hosting: headers: [ ... ] } in it, but then invoking the emulator with --config ./firebase.dev.json complains that all other sections are missing, which they are.
So it isnt merging the whole file, it looks like just the hosting emulator always loads firebase.json regardless of --config and then applies ---config <path> over the top.
Insanity
[REQUIRED] Steps to reproduce
firebase.json
// usual stuff plus:
"headers": [
{
"source": "/",
"headers": [
{
"key": "WTF",
"value": "is going on?"
}
}
firebase.dev.json
// usual stuff but no "headers"
run firebase emulators:start --config ./firebase.dev.json
request localhost:5000/
observe the presence of the WTF header
[REQUIRED] Expected behavior
--config only loads the provided config.json
[REQUIRED] Actual behavior
Hosting emulator seems to always load at least the headers section from firebase.json, havent tested other sections
Theres nothing in the logs of any value, it doesn't print anything to say which config file its loaded except repeating the Command you use to invoke it.
[REQUIRED] Environment info
firebase-tools: 15.2.1
Platform: Ubuntu
[REQUIRED] Test case
I want to have cache headers when deployed to live, but not on dev.
So I've made a
firebase.dev.jsonwhich is a copy offirebase.json, but without thehosting.headerssection.However, when running
firebase emulators:start --config ./firebase.dev.jsonit also seems to load thefirebase.jsonbecause requests are returning the configured headers.I've verified this by adding the following header
to
hosting.headersinfirebase.json, rebooting the emulators and this header appears (so its not browser caching or anything else mad, its genuinely coming from thefirebase.json.So then I made the assumption that it must merge
firebase.jsonwith whatever your provide to--configdespite this being undocumented.So i make a base
firebase.json, thenfirebase.dev.jsonis just{}andfirebase.prod.jsonjust has{hosting: headers: [ ... ] }in it, but then invoking the emulator with--config ./firebase.dev.jsoncomplains that all other sections are missing, which they are.So it isnt merging the whole file, it looks like just the hosting emulator always loads
firebase.jsonregardless of--configand then applies---config <path>over the top.Insanity
[REQUIRED] Steps to reproduce
firebase.json
firebase.dev.json
run
firebase emulators:start --config ./firebase.dev.jsonrequest
localhost:5000/observe the presence of the
WTFheader[REQUIRED] Expected behavior
--configonly loads the provided config.json[REQUIRED] Actual behavior
Hosting emulator seems to always load at least the headers section from
firebase.json, havent tested other sectionsTheres nothing in the logs of any value, it doesn't print anything to say which config file its loaded except repeating the Command you use to invoke it.