jacob
jacob

Reputation: 2896

Are multiple firebase.json deployment files supported for single project?

Currently, I have a project containing two Hosting targets and a bunch of functions. It's all in one source code directory tree with a single firebase.json file.

I'd like to break it up to isolate them and make it more manageable. Is it supported to deploy with a firebase.json file that doesn't contain all the hosting targets and functions for a project? If I were to deploy based on one firebase.json file, would it implicitly affect any running hosting targets or functions for that project that are not defined in the file, e.g., delete them?

Upvotes: 1

Views: 1066

Answers (1)

Michael Bleigh
Michael Bleigh

Reputation: 26313

Hosting deploys will not be affected when split across multiple project directories -- only sites specified as targets in firebase.json will be affected (or the project's default site if no targets are specified).

Cloud Functions deploys will not automatically delete conflicting functions from another project directory (unless the --force option is supplied); however, you will be asked during the deploy if you want to delete functions not specified in the current directory.

For Cloud Functions, if you split them up we recommend always using e.g. --only functions:fn1,functions:fn2 to limit the deployment scope. Note that you can group exported functions to make this easier (see docs).

Upvotes: 1

Related Questions