Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use a folder name other than ‘functions’ for the cloud functions in my firebase project?

I have my source organized in a way that makes functions an awkward name for the location of my cloud functions source. I'm using the "main" property in the package.json to specify the source file but the deploy tool looks in functions for package.json. I've read all the docs available for the config file but don't see anything for the cloud functions.

The init command doesn't even add a section in the config file.

like image 248
Mike Avatar asked Apr 15 '17 00:04

Mike


People also ask

What is the difference between cloud run and cloud function?

Cloud Functions allow you to choose from a set of programming languages and runtimes that is not configurable without requiring that you do anything other than deploying your code whereas Cloud Run allows you to choose any kind of backend configuration, but it requires that you supply a docker configuration that ...


1 Answers

I had this same issue and found the answer by reading the source code for firebase-tool. (but not in the documentation!)

You can add this to firebase.json to rename the functions folder:

"functions": {
    "source": "<your-folder-name>"
}
like image 117
swiley Avatar answered Sep 18 '22 16:09

swiley