From 79ce5175db66b533dcc52fb994593a3a101267d5 Mon Sep 17 00:00:00 2001 From: Austen Frostad Date: Mon, 4 Apr 2022 16:45:53 -0700 Subject: [PATCH 1/2] include "heroku-postbuild" Add a quick reference to the essential step of configuring the "heroku-postbuild" command in the package.json --- content/en/deployments/heroku.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/en/deployments/heroku.md b/content/en/deployments/heroku.md index 9e65c1ad9a..c419d91964 100644 --- a/content/en/deployments/heroku.md +++ b/content/en/deployments/heroku.md @@ -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 SSR 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 From ccbdebb7d05a08d3989d59980f9f7a1bfdfe406b Mon Sep 17 00:00:00 2001 From: Austen Frostad Date: Mon, 4 Apr 2022 17:49:42 -0700 Subject: [PATCH 2/2] Update heroku.md --- content/en/deployments/heroku.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/deployments/heroku.md b/content/en/deployments/heroku.md index c419d91964..16689b0ba7 100644 --- a/content/en/deployments/heroku.md +++ b/content/en/deployments/heroku.md @@ -39,7 +39,7 @@ 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 SSR apps use: +For server apps use: ```json "scripts": { "dev": "nuxt",