Closed
Description
Summary
Discussed in #1170
Originally posted by Muthuveerappanv November 16, 2022
Layers when unzipped (6.0M)
The @types directory occupies 3.6M in the layers data, Since @types aren't used at runtime, they can be readily removed
Without @types (2.4 M)
I did rm -rf node_modules/@types
Using tools like node-prune
I have had much success with using node-prune as well, it takes away unused, files and reduces the size of node_modules
by a good number, but has to be thoroughly tested.
Why is this needed?
Currently the Lambda layers are bundling what it appears to be @types/node
which is 3.6MB:
Given that this is a devDependency
it probably shouldn't be bundled there in the first place.
Which area does this relate to?
Other
Solution
No response
Acknowledgment
- This request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Python, Java