I am using serverless framework to deploy lambda to AWS. I found there are many nested node_modules folders in my project which takes more than 250MB data. I think they are from third party dependencies who have conflict versions of dependencies. How can I exclude packaging all nested node_modules in serverless.yml?
package:
exclude:
- nodejs/node_modules/aws-sdk/**
- nodejs/node_modules/**/node_modules
I have tried above configure but it doesn't exclude them.