flaviostutz / cdk-practical-constructs

A collection of CDK constructs for making the development of AWS based applications easier and safer in a practical way
MIT License
5 stars 6 forks source link

Fix/wso2 custom lambda bundle size #27

Closed MarcioMeier closed 3 months ago

MarcioMeier commented 3 months ago

Summary

Reduces the bundle size of the lambda handler we create for deploying WSO2 application.

As we were mixing some files with IaC code and runtime code, the esbuild adds it to the final bundle. Probably it only happens because we are bundling to CommonJs, the tree-shaking only works properly in ESModules.

Current bundle size of the WSO2 deployment handler

Screenshot 2024-08-10 at 12 44 54

Bundle size of the WSO2 deployment handler with this fix

Screenshot 2024-08-10 at 12 48 55
flaviostutz commented 3 months ago

Great work!!