How to properly do tree shaking to reduce bundle size and separate entry point for each cloud function

You can create a different local Firebase working area (with firebase init) for each function that should deploy in isolation from the others. You will have to instruct the CLI not to overwrite the other functions on deployment using the --only functions:yourFunctionName to deploy it.

Or, you can deploy function using Cloud tools (gcloud) instead of Firebase tools, but you won't be able to use firebase-functions and its TypeScript bindings.

Or, you can lazily load your modules instead of statically loading them at the global scope of your functions, as described in this video.

I don't recommend using webpack. It's not going to be worth your time to get it configured.