bridge
bridge copied to clipboard
Feature proposal: backport `pages: true` option
Environment
Reproduction
Describe the bug
Nuxt 3 allows us to pass pages: true
in nuxt.config.ts
to enable vue-router and prevent using default page. This helps in situation when all pages are defined via extendPages
.
Bridge can have this feature too, because Nuxt 2 has build.createRotes
, which tells builder to use vue-router even if pages
folder does not exist.
Code, which we need to add to that file:
if (config.pages && typeof config.build?.createRoutes !== 'function') {
config.build = config.build || {}
config.build.createRoutes = () => []
}
So proposal is:
- Add the code above to the "config mormalizer" in
module.cjs
and also check how it works with disabled nitro. - Update bridge-schema accordingly
- Decide, does we need to align behavior with Nuxt 2 or Nuxt 3, if this option turned off and
pages
folder does not exist. I didn't check that, but I think it differs.
I can help with 1 and 2 items
Additional context
No response
Logs
No response
Good idea - and thank you. I think it makes sense to align with Nuxt 3 here.