agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

Rebuild layer on custom hash change #106

Closed yuvalyacoby closed 1 year ago

yuvalyacoby commented 2 years ago

Our use case:

In our monorepo, we have some local packages we use in the lambdas. We don't publish these packages to any registry, but reference locally. Since it is referenced by file:.. , changes to these packages aren't identified by the plugin (no changes to package.json)

Solution

This PR will allow us to calculate hash for these packages code, and once it is changed, the layer will rebuild the node_module with updated code.

I believe this can be useful for more custom use cases.

@agutoli hope you find it useful

agutoli commented 1 year ago

Hey, @yuvalyacoby, nice one. Sorry for the late reply. I'm very busy currently and have almost no time to work on this.

Thank you so much for this PR.