Webpack is not packing dependencies into code

I ran into some similar issues which i discussed here: Serverless Webpack Bundling Best Practices

I was never able to find an official answer, but it seems like the default approach where the node_modules folder is included in the deployment zip is the best practice. I think there are sometimes issues when webpack bundles things that are running server side.

I have somewhat of a solution in my previous post, where you specifically highlight to webpack to include some packages in the bundle, but this doesnt seem very robust to me, so I stayed with the default approach.