charoitel / lambda-layer-canvas-nodejs

Cairo backed Mozilla Web Canvas API implementation layer for AWS Lambda
https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs
MIT License
87 stars 22 forks source link

Remove mocha from layer #20

Closed jonasgeiler closed 1 year ago

jonasgeiler commented 1 year ago

Hey there! Thanks for your great layer - really helped me save some time.

Anyways I noticed that the ZIP file of the layer includes the mocha package and all its dependencies which increases bundle size while not being needed in production.

You should consider adding a npm rm mocha in your build script after running the test command. I haven't tested the size difference but it might actually be a Megabyte or two, and I'm pretty sure no one is using it.

Let me know what you think about it! 🙂

charoitel commented 1 year ago

Thanks for your suggestion. That's great to have any idea to further improve the layer.

Would do some more round of works here and target to release in next release. Thank you~

charoitel commented 1 year ago

A new maintenance release is available through AWS Serverless Application Repository.

Unfortunately, the package size is even bigger after removed Mocha but adding Chart.js. May try to see if there is any chance to make the layer into different sublayers. Please deploy and try. Thank you.