Firebase-tools: Functions deploy command ignores any hidden files (files starting with .)

Created on 27 Mar 2017  路  6Comments  路  Source: firebase/firebase-tools

Functions deploy command ignores any hidden files (files starting with .) and there isn't a way to configure this via firebase.json

Why don't we have a config like this as for hosting part

{
  "hosting": {
    "public": "app",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

The use case for this is when building a bundle to be deployed, certain frameworks output hidden files that need to be uploaded.

Most helpful comment

Hi @laurenzlong,
thank you for your reply.
I know what is the purpose of this config, but when I use firebase.json with configuration like this:

{
  "functions": {
    "source": "./",
    "ignore": [
      "README.md",
      "package-lock.json",
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

it seems that it has no effect and all defined files in "ignore" rule are deployed (except node_modules).
I am using the latest version (3.9.2) of firebase-tools.
A similar configuration for "hosting.ignore" works well.

All 6 comments

I believe the culprit is here: https://github.com/firebase/firebase-tools/blob/b428355023b5df4d06fa28123da825bb870ba9cf/lib/prepareFunctionsUpload.js#L104

This is only the Functions implementation but the Hosting should be in the similarly named file.

Thanks for hunting down the line to fix @jthegedus ! Just made PR for the fix. I don't believe hosting has the same issue. It's a different process (tarball instead of zip).

@abstractpoint we do also now support functions.ignore inside of firebase.json, give it a try!

Hello @laurenzlong. I tried to use "functions.ignore" inside of firebase.json, but it doesn't work for me. Are you sure, that it is already implemented in "firebase-tools"?
It would be really useful if the parameter "ignore" also worked for the Cloud Functions.

Hey @kroupacz , that's what functions.ignore means, it's to indicate which files inside of the functions/ folder to ignore when deploying Cloud Functions for Firebase. Is that what you mean?

Hi @laurenzlong,
thank you for your reply.
I know what is the purpose of this config, but when I use firebase.json with configuration like this:

{
  "functions": {
    "source": "./",
    "ignore": [
      "README.md",
      "package-lock.json",
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

it seems that it has no effect and all defined files in "ignore" rule are deployed (except node_modules).
I am using the latest version (3.9.2) of firebase-tools.
A similar configuration for "hosting.ignore" works well.

Was this page helpful?
0 / 5 - 0 ratings