Zenko
Zenko

Reputation: 2559

All files are included in every Cloud Function even when it is not related

In my project I create several Cloud Functions. Some files are not even related to one another. Such as Readme file.

But somehow in EVERY Cloud Function all files are included.

  1. Does it count towards the function's size?
  2. How do I make sure that only necessary files are included in a function?

Thank you

Upvotes: 0

Views: 120

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317467

If you're referring to functions deployed by the Firebase CLI, everything in the functions folder (except node_modules) is deployed to the server container built for each function. It's not trying to be smart about figuring out which files go where - it simply bundles up the entire thing.

  1. No, and you aren't billed for the size of deployed content anyway.
  2. This behavior can't be changed. If you want to have full control over each function's deployment, then you will need to use a different project for each function. But honestly, unless you know what you're trying to optimize, it's not worth it.

Upvotes: 1

Related Questions