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

Unnecessary files in the slug #751

Open
stof opened this issue Mar 31, 2020 · 4 comments
Open

Unnecessary files in the slug #751

stof opened this issue Mar 31, 2020 · 4 comments

Comments

@stof
Copy link

stof commented Mar 31, 2020

Trying to reduce the slug size, I investigated what ends up as part of the 86MB .heroku/node folder (as reported by du -h -d 1 .heroku in a one-off dyno).
Among this size, we have 6.3MB contributed by .heroku/node/lib/node_modules/npm/docs. Including the npm documentation in the slug looks unnecessary to me, and that represents 7% of the (uncompressed) size contributed by the buildpack.

Note that the man, scripts (containing npm development tooling) and changelogs folders of the npm install could probably also be removed in the cleanup (but they are much smaller).

@danielleadams
Copy link
Contributor

Hi @stof, thanks for raising this - we download the node binaries as is, which include npm, and release them to our own S3 buckets. I'm not sure the reasoning for Node having the npm docs there, but it may warrant a discussion/open issue over on Node.

On the flip side, I'd like to remove any unused artifacts that get pulled into slugs regardless, so I'll look at what we can do on the Heroku binaries/buildpack end.

@stof
Copy link
Author

stof commented Apr 14, 2020

Well, for the docs folder, which seems to be the source of the website, this seems indeed questionable. The fact that we also have the scripts folder containing development tooling makes me wonder whether they ever filtered the content they ship.

The man folder is probably used for npm help (unless they actually duplicate the content), but that's not a command you will run on heroku.

@danielleadams
Copy link
Contributor

I can take a look at this. I'll ask if we can remove the docs directory.

As for npm help, people often run scripts in dyno if they have created a one/off dyno, so we will want to keep that.

@camerondavison
Copy link

Is it possible to use something like https://github.com/istrategylabs/heroku-buildpack-node-cleanup and delete them from the slug?

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

No branches or pull requests

3 participants