Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depends on 5 megabytes of lodash just for _.get() #200

Closed
tomchiverton opened this issue Dec 8, 2022 · 2 comments
Closed

Depends on 5 megabytes of lodash just for _.get() #200

tomchiverton opened this issue Dec 8, 2022 · 2 comments
Labels

Comments

@tomchiverton
Copy link
Contributor

Adding this plugin balloons the deploy size.

Take the built .serverless/*.zip and unpack it

Observe the node_modules/* folder sizes. lodash is the biggest consumer at 5 meg

$ npm list -prod -all
npm WARN config production Use `--omit=dev` instead.
xxxxx@0.1.0 /home/xxxxx/web-site
├─┬ promise-mysql@5.2.0
│ ├── @types/bluebird@3.5.38
│ ├─┬ @types/mysql@2.15.21
│ │ └── @types/node@18.11.11
│ ├── bluebird@3.7.2
│ └─┬ mysql@2.18.1
│   ├── bignumber.js@9.0.0
│   ├─┬ readable-stream@2.3.7
│   │ ├── core-util-is@1.0.3
│   │ ├── inherits@2.0.4
│   │ ├── isarray@1.0.0
│   │ ├── process-nextick-args@2.0.1
│   │ ├── safe-buffer@5.1.2 deduped
│   │ ├─┬ string_decoder@1.1.1
│   │ │ └── safe-buffer@5.1.2 deduped
│   │ └── util-deprecate@1.0.2
│   ├── safe-buffer@5.1.2
│   └── sqlstring@2.3.1
├─┬ serverless-aws-static-file-handler@4.0.1
│ ├── lodash@4.17.21
│ ├─┬ mime-types@2.1.35
│ │ └── mime-db@1.52.0
│ └── mustache@4.2.0
└── yesql@5.0.0

$ cd .serverless
... unzip *zip ...
$ cd */node_modules
$ du -skh *|sort -h| tail -n 2
724K    bluebird
5.0M    lodash

As far as I can see _.get() is the only thing used from all of lodash, it could be replaced with own impl.

serverless-aws-static-file-handler@4.0.1
node 18
Ubuntu 22.04 LTS

tomchiverton added a commit to tomchiverton/serverless-aws-static-file-handler that referenced this issue Dec 8, 2022
@activescott
Copy link
Owner

Love it! I'll help get this through!!

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants