-
|
Apologies this is probably just lack of understanding on my part but I'm trying to understand how the trimming behaviour in .NET should work with the annotations library. I have a project using Let's say this project references another project with classes for data access etc. If I have some functions that use these data access classes but another function that doesn't use any of these external classes at all i.e... I would expect that the deployed bundle size for the above lambda would be much smaller than the bundles for my other functions. At the moment I am seeing them all deploy with the same size bundle. Is there any way for this to be the case or do we effectively need to deploy the whole API and all dependencies for each individual function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
To use Annotations for AOT you have to use the |
Beta Was this translation helpful? Give feedback.
To use Annotations for AOT you have to use the
LambdaGlobalPropertiesattribute with theGenerateMainset to true. At the time of compilation we don't know which function will be invoked so the generatedmainis basically a switch statement for all of the Lambda functions defined in the project with the value of theANNOTATIONS_HANDLERenvironment variable control which case to run. So from the .NET trimmer's point of view all Lambda functions are possible to be called so there is no trimming at a per function level.