N
Nuxt8mo ago
Tirius

Tasks that require use of node modules.

I need to generate menu for a Nuxt pages inside /pages/abc/ directory, what options do we have for that kind of task? Edit: I'm talking about static generated friendly solution.
2 Replies
Single
Single8mo ago
If i understand you correctly, you want to generate a Menu (component) that holds all available routes, thus reflects the pages/ directory recursively?
const router = useRouter()
console.log(router.options.routes)
const router = useRouter()
console.log(router.options.routes)
Tirius
TiriusOP8mo ago
That's can be useful for that task, thanks. But in general my question was where to run code that require use of node modules/file system, so far I found two solutions, nuxt hooks inside nuxt.config or a custom script that runs before nuxt.
Want results from more Discord servers?
Add your server