Skip to content

docs deployments/heroku/ - include part about "heroku-postbuild" #2052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions content/en/deployments/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ Your app's Settings section on the Heroku dashboard should contain this:

![nuxt config vars Heroku](https://user-images.githubusercontent.com/23453691/116850762-81ea0e00-abf1-11eb-9f70-260721a1d525.png)

Second, configure your app's `package.json` for the Heroku build process by adding a `heroku-postbuild` object to the scripts section to run the appropriate `nuxt` command for your app's [`nuxt.config.js` `target`](https://nuxtjs.org/docs/configuration-glossary/configuration-target/).
For server apps use:
```json
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"heroku-postbuild": "npm run build"
},
```
or for static apps:
```json
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"heroku-postbuild": "npm run generate"
},
```

Finally, we can push the app on Heroku with:

```bash
Expand Down