There are size limits when deploying on serverless or edge infrastructure so developers have to care about that. The providers also typically charge by compute seconds * memory consumed so a larger executable costs real money as well.
You would use deno as base layer, your dependencies in another layer, your code is in the last layer.