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.
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.
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:
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.