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

Coerce typings to ignore particular route #111

Closed
avdwio opened this issue Aug 3, 2023 · 2 comments
Closed

Coerce typings to ignore particular route #111

avdwio opened this issue Aug 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@avdwio
Copy link

avdwio commented Aug 3, 2023

I have some paths in my application that are designed as either a) catch-all paths, or otherwise b) designed only to be accessed from an external link (think email verification). Is there a way to coerce nuxt-typed-router to NOT generate types for a given path?

Specifically, I have a file pages/[...slug.vue] which will redirect users who go to an incorrect route. This breaks all of my path types as now navigateTo etc. will take any string.

Another usecase is when we are ignoring paths in the application build, such as in

I'm suspecting we may not be able to do this after reading through this issue, OR ignored routes could be designated within nuxt.config.ts? Unsure, but keen to get some thoughts.

@victorgarciaesgi
Copy link
Owner

Hello, I see what you mean!
I think it would me cleaner to do it by configuration, i'll see what api work best for most cases, and without caveats.
Like having a

ignoreRoutes: ["[...slug].vue", "admin/[...404].vue"]

Do you think it would be right?

@victorgarciaesgi victorgarciaesgi added the enhancement New feature or request label Aug 17, 2023
@victorgarciaesgi
Copy link
Owner

Released in 3.3.0, with the experimentalIgnoreRoutes option

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

No branches or pull requests

2 participants