Maintenance: Remove @types/node
from Lambda Layers
#1171
Labels
automation
This item relates to automation
completed
This item is complete and has been merged/shipped
discussing
The issue needs to be discussed, elaborated, or refined
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
The text was updated successfully, but these errors were encountered: