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 Builder.io . After some research I’ve found out that this need to be added to the nuxt.config.js :
import { builder } from '@builder.io/vue'
export default {
target: 'static',
build: {
extend(config, context) {
if (context.isServer) {
builder.init('USE_YOUR_KEY_HERE')
builder
.getAll('page', {
options: { noTargeting: true },
omit: 'data.blocks',
})
.then((results) => {
results.forEach((result) => {
this.buildContext.options.generate.routes.push(result.data.url)
})
})
}
},
},
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 Builder.io and I have to say: it’s fantastic! Great work!