-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
proposal: provide a standardised .npmignore
file for use across plugin and util repos
#42
Comments
Thank you for the numbers. It is a little surprising the amount of data that is transferred and saved in your example. However, you are talking about a month long timeframe distributed across the whole globe. These numbers seem very reasonable. The issue I have with
This means that as soon as you add a Even more frustrating is
The result is that once the |
No worries @jsumners, thanks for the response! Completely understandable. |
The files are can contain directories as well, and each file in the directory is added to the package. It seems fastify uses the lib directory for code in the NPM package, so adding lib is sufficient. |
Prerequisites
Issue
Summary
Reduce size of published packages by using
.npmignore
, orfiles
inpackage.json
.Motivation
With the Greener NHS programme, National Health Service organisations and bodies across the UK are looking at ways to become carbon neutral, reduce energy consumption, combat climate change, and at the same time save money that can then be spent instead on improving patient care.
The recent heatwaves and wildfires across Europe have exemplified the need to prioritize this.
I've been looking at this from the tech perspective within my hospital, and have already called out a supplier for their unnecessarily heavy web app (loading various versions of jquery and lodash and then not using them). It would be hypocritical for me to not look at the tools and frameworks we use internally, such as Fastify.
Whilst previous discussions have looked at this issue through the lenses of improving developer experience, environmental impacts have not been considered.
Rationale and Alternatives
Ignoring unused files could speed up installations, lower bandwidth usage, improve reliability on spotty connections, and leave more room on the hard drive. Registries and mirrors would also benefit; reduced resources likely means lower energy consumption and lower costs.
Users could use yarn's autoclean CLI to remove the unused files, but the files have already been downloaded and bandwidth wasted at this point.
Implementation
Prior discussions have stated the want to include test files in published packages.
With this in mind, we could still ignore files and directories related to:
Example
@fastify/static
.github
andexample/**
removed: 162.9kB (~23% reduction).github
,example/**
, andtest/**
removed: 11.8kB (~94% reduction)@fastify/static is downloaded around 400,000 times a month at present (will grow as more migrate from fastify-static) meaning it uses ~84.2GB/month.
Removing just the CI/CD and examples would drop that to ~65.16GB/month; removing the test files as well would drop that to ~4.72GB/month.
Previous discussions
The text was updated successfully, but these errors were encountered: