New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(nuxt): allow pages:extend
to enable pages module
#20806
fix(nuxt): allow pages:extend
to enable pages module
#20806
Conversation
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Daniel Roe <daniel@roe.dev>
β¦fo on composables
β Live Preview ready!
|
Thank you for your fast work, but I think there's one edge case left behind which is not my case, but may happen to others later. You can also extend pages by using hook - Shouldn't it be better to set it after |
@edgarsn you're right! The problem is that I'll try to figure something out π Edit: If it's like that, then the hook can be called inside the |
The safest thing is probably to do this within const pages = await resolvePagesRoutes()
await nuxt.callHook('pages:extend', pages)
if (pages.length) {
return true
} We can keep the previous early returns for |
I agree, but that means that the hook will be called multiple times if there are no pages, so I wasn't sure if that's a good idea. |
β¦r/nuxt into feat/use-pages-from-module
pages:extend
to enable pages module
π Linked issue
resolves #20801
β Type of change
π Description
Sets
pages
option totrue
ifextendPages
is called.If
extendPages
gets called, it means that there are actually some pages, so we can set tepages
option totrue
?+ updates typo in documentation
π Checklist