I’m writing a Django app that includes some CoffeeScript in it. To allow for this I’m using django-compressor which compiles the CoffeeScript to JS before the app is launched. django-compressor requires that NPM is installed on the machine to compile the CoffeeScript.
Now I want to deploy this app on Heroku. I can’t put npm in my requirements.txt so I am wondering how I can get npm on the Heroku server?
Note: The multi buildpack is a much nicer way to accomplish this these days 🙂
I’ve created a fork of the official Python heroku buildpack that allows an optional
npm_requirements.txtfor installing such dependencies.I am now using coffeescript and less-css with django-compressor on heroku 🙂
https://github.com/jiaaro/heroku-buildpack-django
Edit: To switch to my buildback from the standard buildpack:
use the
herokucommand line app to set theBUILDPACK_URLenvironment variable: