5

I want ways to reduce my slug size, and I was wondering if it will be ok to ignore those folders /node_modules, /storage, /tmp, or will that bring me some issues?

Also, please let me know any other tip you may have to descrease the slug size.

dani24
  • 2,108
  • 2
  • 26
  • 28

1 Answers1

2

TL;DR You can remove node_modules from your slug.


But what I acctually did was to add the next build pack as the last buildpack in Heroku web site, and it significantly reduced my slug size:

Buildpacks

and also I created a file called .slug_post_clean adding a line with node_modules.

It is very important to put it as the LAST buildpack, if not, then it won't be very efficient.

Likely you can accomplish the same thing without this buildpack.

dani24
  • 2,108
  • 2
  • 26
  • 28
  • use this commit for the buildpack, otherwise you it won't work because of the owner of the repo added to archive it. I'm adding '#323cc79b69671070d5b51f8795e51d8ff8150a63' to poin to a specific commit. https://github.com/Lostmyname/heroku-buildpack-post-build-clean#323cc79b69671070d5b51f8795e51d8ff8150a63 – Meir Jun 23 '23 at 03:52