-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Ability to prevents page generation in generate:page #7440
Copy link
Copy link
Closed
Description
What problem does this feature solve?
What if we can add a single boolean to the page variable to conditionally control page generation?
What does the proposed changes look like?
// Call hook to let user update the path & html
const page = { route, path: fileName, html, generate: true }
await this.nuxt.callHook('generate:page', { page, errors: pageErrors })
await this.nuxt.callHook('export:page', { page })
if (page.generate) {
page.path = path.join(this.distPath, page.path)
...
}
return page.generateOr for being fully backward compatible we could use export:page hook:
const page = { route, path: fileName, html, generate: true }
...
await this.nuxt.callHook('export:page', { page, errors: pageErrors })
if (page.generate) {
...Reactions are currently unavailable