0

I hit following problem working with firebase functions, I split functionality into different files, few of them have only custom utility logic.

The thing is that with firebase CLI I only can upload separate functions with :

firebase deploy --only functions:someFunction

But in this case the utility file which function someFunction uses does not get uploaded. To refresh logic in separate files I need to redeploy all the functions by executing :

firebase deploy functions

and I hit deployment limit just in few deploys.

Is there any way I can redeploy a separate file to the server?

UPD

By utility file I mean files that contain logic and used in functions. Say we have function someFunction in the index.js that goes like this :

const commons = require('./commons');    
exports.someFunction = function() {
        common.sayHello();
}

In this case commons is a plain javascript file (commons.js) that has utility functions, other words - utility file.

exports.sayHello = function() {
    console.log('hello!');
}

This is exactly the file I would like to redeploy separately.

Anton
  • 1,001
  • 9
  • 23
  • I don't understand what you mean by "the utility file which function someFunction uses does not get uploaded". What are you observing? Please edit the question to explain exactly what you expect your function to be doing after deployment, and how it does not behave as expected. – Doug Stevenson Sep 12 '18 at 16:58
  • @DougStevenson I updated question – Anton Sep 15 '18 at 08:35

1 Answers1

1

It's not possible to upload only a single file when when deploying functions. The entire contents of the functions folder (except node_modules) is replaced for every function at every deployment, even if you are deploying just one function at a time.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441