NOTE: This is not an officially supported Heroku buildpack. It is used by the Heroku Dashboard and provided as open source for transparency. Use at your own risk.
heroku-buildpack-ember-cli enables you to run your Ember CLI application on Heroku. It provides the ability for changing ENV variables on-the-fly without modifying your codebase or redeploying your application. Primary features of this buildpack include:
static.jsonfile to drive heroku-buildpack-static
environment.jsfiles. See this issue
CDN_HOSTvariable is changed on Heroku
storeConfigInMeta: true(which is also the default value).
Rather than duplicating code, heroku-buildpack-ember-cli builds on top of other buildpacks, namely heroku-buildpack-nodejs for node.js support as well as heroku-buildpack-static to actually serve the assets to your users. If you need support for private dependencies, check out heroku-buildpack-github-netrc.
Here's a quick cheatsheet for adding the required buildpacks to your application; simply copy and paste the following:
heroku buildpacks:clear heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nodejs heroku buildpacks:add https://github.com/heroku/heroku-buildpack-ember-cli heroku buildpacks:add https://github.com/hone/heroku-buildpack-static
By default, the nodejs buildpack only installed
dependencies and not
devDependencies. And by default, Ember CLI puts everything in
devDependencies. Doh! Fortunately, there's a simple fix:
heroku config:set NPM_CONFIG_PRODUCTION=false
Be sure to run this before deploying.
If your project includes an
app.json file (used by Heroku for Pipelines and Heroku Button) be sure to update it to reflect the changes above. In particular, you'll want to set the
NPM_CONFIG_PRODUCTION variable as well as specifying the correct buildpacks
This buildpack injects a default static.json file into the application slug unless one is provided by your application. Warning The provided
static.json sets cache headers on
/assets/** which is only desirable if you are leveraging fingerprinting in your project!
Copy the snippet above into CLI.