gjaldon/heroku-buildpack-phoenix-static

Complains about missing Brunch, but I am using Webpack

Closed this issue · 2 comments

remote:        Running default compile
remote:        /app/tmp/buildpacks/9c47a362692688524e86000de35251234726449a19851f29f82387b8d8b2da550db082b36e99243f82a708aff896040ed9c7dc1c8d5bc89a74e6c0d234c486ad/compile: line 1: brunch: command not found
remote:  !     Push rejected, failed to compile Phoenix app.
remote:
remote:  !     Push failed

Any ideas?

So I've put this in my compile script (I am using Phoenix 1.3 and the ultimate boilerplate https://github.com/MainShayne233/ultimate-phoenix-boilerplate):

cd $phoenix_dir
mix assets.digest
mix phoenix.digest

And now it works.

Worth noting, if you're coming here after following any of the following tutorials:

https://github.com/dwyl/phoenix-chat-example
https://github.com/dwyl/learn-heroku/blob/master/elixir-phoenix-app-deployment.md

You will need to add a compile file to the root of your project with the following contents:

# app_root/compile
cd $phoenix_dir
cd assets && npm install && npm run deploy && cd ..
mix "${phoenix_ex}.digest" #use the ${phoenix_ex} variable instead of hardcoding phx or phoenix

The compile file is described in more detail here: https://github.com/gjaldon/heroku-buildpack-phoenix-static#compile