Skip to content
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

Feature proposal: backport pages: true option #687

Open
AndreyYolkin opened this issue Jan 20, 2023 · 1 comment
Open

Feature proposal: backport pages: true option #687

AndreyYolkin opened this issue Jan 20, 2023 · 1 comment
Labels

Comments

@AndreyYolkin
Copy link
Contributor

AndreyYolkin commented Jan 20, 2023

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:

  1. Add the code above to the "config mormalizer" in module.cjs and also check how it works with disabled nitro.
  2. Update bridge-schema accordingly
  3. 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

@danielroe
Copy link
Member

Good idea - and thank you. I think it makes sense to align with Nuxt 3 here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants