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

Route page paths not generated #20

Open
Friedpanseller opened this issue Jan 9, 2025 · 0 comments
Open

Route page paths not generated #20

Friedpanseller opened this issue Jan 9, 2025 · 0 comments

Comments

@Friedpanseller
Copy link

Friedpanseller commented Jan 9, 2025

When routes are generated only 'page' routes like page.tsx are generated instead of route routes like route.ts

next-routes/src/utils.ts

Lines 91 to 94 in bd2a9e0

return (
VALID_PAGE_EXTENTIONS.includes('.' + ext!) &&
name!.split('.').shift() === 'page'
);

This should be updated like below

      return (
        VALID_PAGE_EXTENTIONS.includes('.' + ext!) &&
        ( name!.split('.').shift() === 'page' || name!.split('.').shift() === 'route')
      );

In the cleanPath function we also need to add .replace(/\/route$/, '')

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

No branches or pull requests

1 participant