0.3.0 • Published 1 year ago
smaller-modules v0.3.0
smaller-modules
Shrink node_modules for deployment
Introduction
Are you having problems getting node_modules
down to a reasonable size?
An error occurred (RequestEntityTooLargeException) when calling the UpdateFunctionCode operation: Request must be smaller than 69905067 bytes for the UpdateFunctionCode operation
Do you hit size limits, even when creating separate layers to contain dependencies?
An error occurred (InvalidParameterValueException) when calling the UpdateFunctionCode operation: Unzipped size must be smaller than 262144000 bytes
Here's a utility that might help.
Quickstart
Zip up node_modules
for Lambda
smaller-modules --zip --file dist/handler.js
Copy dependencies of compiled output to a new directory
smaller-modules --copy --directory dist --output-subdirectory smaller_modules
List dependencies of a .js
file
smaller-modules --list --file dist/index.js --output-path dependencies.txt
or print it to the command line
smaller-modules --list --file dist/index.js
Usage
Zip up node_modules
for Lambda (in long-hand)
smaller-modules --zip --file dist/index.js --output-subdirectory nodejs --output-path node_modules.zip
Use with packages in a mono-repository
# Run from packages/<package-name>
smaller-modules --list --file dist/index.js --base "../.."
0.3.0
1 year ago
0.3.0-alpha.0
1 year ago
0.3.0-alpha.1
1 year ago
0.2.4
2 years ago
0.2.3
2 years ago
0.2.2
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago