Closed TomKaltz closed 4 years ago
Isn't it possible to do this only using glob? I believe you can create ignore groups, in the same way you would ignore *.spec
files. Something like
**/!(*.spec|*.ignore).js
it seems as though this here emulating: process.env.hasOwnProperty('FIREBASE_PROJECT')
is the crux of this feature - this detects if we are emulating.
Just as a side note - most things that people use functions for that they don't want deployed can usually just be done locally with admin sdk. For example, you can write a script in js/ts and then use node/ts-node to run it. You don't need to create a local function unless you somehow call it from your emulated front end. You can access emulated firestore or live firestore just using admin sdk or @firebase/testing
.
Standalone admin sdk solves my use case. Well played!
Similar to what was implemented here... https://gist.github.com/theprojectsomething/2076f856f9c4488366dc88e6e8ab2f20
...it would be nice to be able to specify a modifier in the filename for local-only functions. I am currently using a glob pattern to ignore files with the word "ignore" in them but preventing local-only endpoints from deploying would be great!