Can I slugignore `node_modules`, `tmp` and `storage` folders?

Viewed 126

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.

1 Answers

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.

Related