Feature proposal: backport `pages: true` option
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 285
- Forks
- 33
- Avg merge
- 22h 38m
- Merged PRs (30d)
- 3
Description
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.cjsand 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
pagesfolder 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/bridge/module.cjs at the config normalizer and review the proposed pages/createRoutes interaction, including behavior when Nitro is disabled. Then inspect bridge-schema and compare the intended Nuxt 2 and Nuxt 3 behavior when pages is disabled or no pages folder exists. Done means the option is normalized, the schema is updated, and the compatibility behavior is explicitly settled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nuxtjs, typescript
- Domain
- build-system, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100