The @lambda-middleware/utils is indirectly including the entire aws-sdk package via the aws-lambda package which is increasing my bundle size to ~350kb
To Reproduce
❯ yarn init -y
❯ yarn add @lambda-middleware/utils
❯ yarn why aws-sdk
yarn why v1.22.10
[1/4] �🤔 Why do we have the module "aws-sdk"...?
[2/4] �🚚 Initialising dependency graph...
[3/4] �🔍 Finding dependency...
[4/4] �🚡 Calculating file sizes...
=> Found "aws-sdk@2.852.0"
info Reasons this module exists
- "@lambda-middleware#utils#aws-lambda" depends on it
- Hoisted from "@lambda-middleware#utils#aws-lambda#aws-sdk"
info Disk size without dependencies: "59.79MB"
info Disk size with unique dependencies: "61.05MB"
info Disk size with transitive dependencies: "61.3MB"
info Number of shared dependencies: 9
Expected behavior
The aws-sdk not be included transitively
Additional context
I believe the core issue is that this package imports both @types/aws-lambda and aws-lambda even though only the type information is needed.
You should be able to just remove the aws-lambda import
Describe the bug
The
@lambda-middleware/utils
is indirectly including the entireaws-sdk
package via theaws-lambda
package which is increasing my bundle size to ~350kbTo Reproduce
Expected behavior
The
aws-sdk
not be included transitivelyAdditional context
I believe the core issue is that this package imports both
@types/aws-lambda
andaws-lambda
even though only the type information is needed.You should be able to just remove the
aws-lambda
import