简体   繁体   中英

Am I expected to manually put lots of file patterns into firebase.json/hosting/ignore?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM