I’m using the aws-nodejs-typescript template, and I’m not sure what I’m doing wrong here. Basically, my deployed ZIP files are including node_modules in its entirety. But if I set webpack: { includeModules: false } }, it leaves out node_modules and doesn’t minify/bundle dependencies into the JavaScript code.
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.