Minify JS code before packaging

Hi, I want to deploy a function that will be attached to a CloudFront event. Problem is that CloudFront will accept only lambdas that are 1mb or less in size. So I am looking to minify the codes.

I found a plugin from 2 years ago, which doesn’t seem to be maintained (last commit was 2 years ago): https://github.com/serverless/serverless-optimizer-plugin

Is there a more up to date method?

Thanks!

check out https://github.com/serverless-heaven/serverless-webpack

2 Likes

Cool, thanks @DavidWells! This is pretty much what i was after. Though I managed to work it out already in a more manual way :slight_smile: