Skip to content

Maintenance: Remove @types/node from Lambda Layers  #1171

Closed
@dreamorosi

Description

@dreamorosi

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
Screen Shot 2022-11-16 at 12 25 00 PM

Without @types (2.4 M)

Screen Shot 2022-11-16 at 4 59 59 PM

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.

image

Why is this needed?

Currently the Lambda layers are bundling what it appears to be @types/node which is 3.6MB:
image

image

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

Metadata

Metadata

Assignees

Labels

automationThis item relates to automationcompletedThis item is complete and has been merged/shippeddiscussingThe issue needs to be discussed, elaborated, or refined

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions