Buildpack
Buildpacks are responsible for transforming deployed code into a slug, which can then be executed on a dyno. Buildpacks are composed of a set of scripts, and depending on the programming language, the scripts will retrieve dependencies, output generated assets or compiled code, and more. This output is assembled into a slug by the slug compiler.
https://devcenter.heroku.com/articles/buildpacks
buildpacks are responsible for transforming an app’s source code into an executable package that is compatible with that stack.
HerokuのStack
Herokuでpackage.lockがRoot directoryにあると依存性解決をやってくれるのは、Node.jsのBuildpackが入っているから
デフォルトだと勝手に検知されるが、PHPとNode.jsの両方を使いたい、などというときには手動で追加する必要がある
https://devcenter.heroku.com/articles/buildpacks#using-multiple-buildpacks
参考:Herokuでyarnをつかう
コマンド一覧 heroku buildpacks --help
今使っているBuildpackを確認する
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app#viewing-buildpacks
code:zsh
$ heroku buildpacks
=== sushi Buildpack URLs
1. heroku/php
2. heroku/nodejs
追加する
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app#adding-a-buildpack
heroku buildpacks:add --index 1 heroku/nodejs
indexはbuildpack実行の優先順位
Scalaのプロジェクトとかだとsbtのビルドより前に、フロントのbuildをpublicに置かないといけなかったりするのでそういうときに使う
地味にハマる
#Heroku