Is this expected behavior for individually packing functions?

Yes, at the moment you do if you want to control the size of your function’s deployment.

Serverless supports all the runtimes that Lambda supports, and so currently doesn’t know (at a code level) what your individual functions require to be packaged with them to work - given the different methods of importing and managing dependencies it’s going to be non-trivial problem to solve programatically.

Having the ability to define includes yourself means you can include non-code related assets (e.g. data files if you wish).

1 Like