Skip to content

Conversation

pashaie
Copy link

@pashaie pashaie commented Sep 29, 2025

Currently, in file based routing, the generated routes.ts file creates the routes object but doesn't export it, making it difficult to build dynamic navigation menus that need to iterate over available routes.

Current generated code:

const routes = {
  '/about': () => import('../src/routes/about.svelte'),
  '/': () => import('../src/routes/index.svelte')
};

Proposed change:

export const routes = {
  '/about': () => import('../src/routes/about.svelte'),
  '/': () => import('../src/routes/index.svelte')
};

This would be a non-breaking change that enables dynamic menu generation and other use cases where programmatic access to the route configuration is needed.

Copy link

changeset-bot bot commented Sep 29, 2025

⚠️ No Changeset found

Latest commit: 1e855d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
sv-router Ignored Ignored Preview Sep 29, 2025 8:03am

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

Successfully merging this pull request may close these issues.

1 participant