-
Notifications
You must be signed in to change notification settings - Fork 5
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
Doesn't take into account rewrites/redirects #15
Comments
Interesting challenge. I haven't myself made use of of rewrites and redirects in Next.js yet, so haven't had to deal with it. While your solution seems feasible, might another option be to just parse the Might be a bit magical though... |
yeah i think since they allow for any function that returns that array of objects, it's tricky, so thats why I was thinking a simple config option to just state extra existant routes is probably the most applicable/letting the user decide how that's done. |
How urgent do you think this is? Based on the docs, it seems to me that rewrites would be fairly complex to support solidly. There are many edge cases it feels like... |
It's not super urgent for me (there's always a workaround to just cast to TypeSafePage if you're feeling confident), but I agree that trying to figure it out from the redirect/rewrite functions could be tricky, hence my suggestion it just be a manual configuration. But yeah doesn't need to be prioritized highly unless it becomes more pressing for me or someone else. |
Idk if there's a way to support it easily, but the generated routes don't seem to read the next.config.js to gather valid rewrites and redirects. Maybe can be an extra parameter to the plugin to just specify some extra manual routes in
next.config.js
, which would be OK - can just pass in the missing values, and its possible to do so without redundant code (define the rewrites as a function, pass it to the nextJS config, and then invoke it to pass the rewrites to this plugin).So this would be a breaking change - the
/plugin
import would instead return a function that produces a NextJS plugin, with an objects blob:The text was updated successfully, but these errors were encountered: