I find that the firebase docs are not clear about what files are uploaded on firebase deploy
. For instance if I have a README.md
, should I manually put it into hosting ignore?
Here it says "firebase deploy
creates a release for all deployable resources in your project directory. ", but it didn't say what is considered "deployable".
In the default firebase.json
for hosting settings, we see this:
"hosting": {
"public": "public",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
The "ignore" field here can be understood in two ways:
A: ignore if found within the public
folder,
B: ignore if found in the whole project folder.
If A, who would put firebase.json
or node_modules
in public
?
If B, then I'll have a ton of various files in the project folder that I'll need to ignore. The most common one is src
, but I have all kinds of others.
The "ignore" field here can be understood in two ways: A: ignore if found within the public folder, B: ignore if found in the whole project folder.
It only applies to content under public, which is the root of deployment. Content outside of that folder is not deployed.
who would put firebase.json or node_modules in public?
I don't know. But it's safe to say that someone's local project configuration should probably not be deployed, regardless of where the file ends up. You are free to remove that from "ignore" if it doesn't apply to you. You are of course obliged to add other ignores if you don't want that content under public to be deployed. Or you can take steps to make sure your public folder contains only content to be deployed. It's up to you.