NuxtJS 2.13.0 is finally here and comes with a great feature we've been waiting for: full static generation ๐ Before this release, it was possible to have full static support using nuxt-payload-extractor module as you can read here.
Starting from version 2.13.0 Nuxt.js has a crawler inside to detect every relative link and generate it. You can disable the crawler setting generate.crawler: false and still add dynamic routes by your own for performance reasons or to add extra routes that the crawler could not detect.
I've just updated my article How to build a Jamstack multi-language blog with Nuxt.js with full static generation support following these steps:
- Remove
nuxt-payload-extractorand all its references innuxt.config.jsandasyncData - Upgrade nuxt to 2.13.0
- Add
target: 'static'to nuxt.config.js - Add new scripts to
package.jsonto export and serve the static site
{
"scripts": {
"export": "nuxt export",
"serve": "nuxt serve",
...
}
- Run
yarn build && yarn exportinstead ofyarn generate
For more information about this awesome feature, please read Going Full Static from the official Nuxt.js blog.
Top comments (0)