The Next Generation Platform is Coming - Get Ready Now!
GitHub Readme.md
Make the official Heroku buildpack for Node.js compatible with other buildpacks
The maximum allowed Heroku slug size (after compression) is 300MB. Image-heavy apps can somethings butt up against this limit, especially when using multiple buildpacks. If you're using Node.js to compile your front-end assets, but not to run your app, you may be able to save a large amount of space by deleting the node_modules
directory before slug compilation.
There is currently an incompatibility between the Node.js and other buildpacks. On dyno boot, the nodejs.sh
startup script sets the WEB_CONCURRENCY
variable. The launch scripts of subsequent buildpacks will pick this us with no way of knowing that it wasn't set by a user.
First, set the Node.js buildpack to compile your assets:
$ heroku buildpacks:set heroku/nodejs
Next, add the Node Cleanup buildpack to get rid of the node_modules
directory:
$ heroku buildpacks:set --index 1 https://github.com/istrategylabs/heroku-buildpack-node-cleanup
Finally, add whichever buildpack runs your app:
$ heroku buildpacks:set --index 2 heroku/python
For more general information about buildpacks on Heroku:
Copy the snippet above into CLI.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.