Nuxt/Vue with Static Hosting: generate pages

I’ve followed this tutorial and added a few pages to my project.
Running Nuxt locally I could see all the pages but when I tried to generate the static version of the app, it only generated the 200.html and not the index.html or the content generated on . After some research I’ve found out that this need to be added to the nuxt.config.js :

import { builder } from ''

export default {
  target: 'static',

  build: {
    extend(config, context) {
      if (context.isServer) {
          .getAll('page', {
            options: { noTargeting: true },
            omit: 'data.blocks',
          .then((results) => {
            results.forEach((result) => {
  generate: {
    routes: ['/']

Is that the correct approach? Or do you recommend any other solution?
Would be nice to have the Static Hosting covered on the tutorial if possible.

By the way, I just started playing with the and I have to say: it’s fantastic! Great work!

Hi @maat thanks for the feedback! I’ll share this with the team. We don’t have any documentation or examples yet for SSG with Nuxt but if this approach has been working for you then go with it! It might also be helpful for the community to post any issues you run into along way. And while you may have already seen these, here are the current starters we have for our Vue SDK that may help:

Vue Starters
Vue SDK Docs

Thanks AJ!
I will check it out…


1 Like