website-v2
website-v2 copied to clipboard
Heroku offers static deployment
Hello,
I noticed that the Deployment section states only deployment for target: server
is possible via Heroku. Actually, static deployment is possible using heroku-buildpack-static
in conjunction with the Heroku buildpack for Node.js.
The order of buildpacks is this:
First, the Node.js buildpack installs all dependencies with npm install
and then runs the build
script in package.json
which should be configured as "build": "nuxt generate"
in the scripts
section of package.json
. This builds the app inside the dist/
folder. Then, heroku-buildpack-static
takes over (it uses nginx). For this buildpack, we need to provide static.json
in the root. Here is a minimal example:
{
"root": "dist",
"routes": {
"/**": "index.html"
}
}
Thank you for the heads up @valentinoli
Would you mind opening a pull request to update the documentation? https://github.com/nuxt/nuxtjs.org/blob/main/content/en/guides/deployment/heroku-deployment.md
Yes, sure, I can do that