-
Notifications
You must be signed in to change notification settings - Fork 365
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
Dependencies to remove/replace #3941
Comments
I marked this as a |
Almost 500MB now. 895 packages in in /opt/homebrew/Cellar/netlify-cli/16.9.1/libexec/lib/node_modules/netlify-cli/node_modules/. Seems a bit excessive.
|
Some dependencies that could be replaced:
|
I recommend reading this: https://github.com/chalk/chalk#why-not-switch-to-a-smaller-coloring-package
The dangers of moving to a smaller package is that there is a reason a package is larger, it handles more edge-cases, which the small package eventually will discover. And so the cycle continues. For example: usmanyunusov/nanospinner#24 Ora handles this already. |
Is your feature request related to a problem? Please describe.
In an attempt to reduce the number of dependencies, and netlify-cli's size, I've made a couple of PRs:
Describe the solution you'd like
I think the following could be implemented to reduce the number of dependencies more (sorted randomly):
High Impact
Medium/low Impact
minimist
withcommander
in builders/netlify-lambda.js; commander is bigger compared to minimist, but commander is already a dependencyomit.js
with Object spread when possible in all projects?read-pkg-up
withfind-up
+ own read functions - chore(deps): remove read-pkg-up #4043find-up
withescalade
in cli and all other Netlify packages: https://packagephobia.com/result?p=find-up%405.0.0%2Cescalade%2Cread-pkg-up%407.0.1del
can be replaced with native when Node.js 12.x is dropped (it can be replaced already but becausefs.rm
/fs.rmDir
has changed it would require a workaround) - fix(deps): remove del dependency #4017, should be removed after Node.js 12.x support is dropped (and also from the other Netlify packages when possible)fs.mkdir('dir', { recursive: true })
padStart
sufficient?Dev only
There are probably more packages that could be replaced, but the above should already help a bit. Feel free to add any other candidates to the list.
Also, this will be better if done across all Netlify packages since deduplication makes a huge impact.
Additional context
The text was updated successfully, but these errors were encountered: