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

Generated Routes do not honor vite.config.ts base #129

Open
theixdev opened this issue Oct 10, 2023 · 3 comments
Open

Generated Routes do not honor vite.config.ts base #129

theixdev opened this issue Oct 10, 2023 · 3 comments

Comments

@theixdev
Copy link

theixdev commented Oct 10, 2023

Describe the Bug

Create an app and update it's vite.config.ts to set a base path to something other than '/' i.e '/Test/'

All routes generated ignore the base path.

Generouted Version

@generouted/react-router 1.15.9

Your Example Website or App or Reproduction

None

Steps to Reproduce the Bug or Issue

Create an app and update it's vite.config.ts to set a base path to something other than '/' i.e '/Test/'

All routes generated ignore the base path.

Expected Behavior

As a user I expect the base path config to be respected so that routes will generate with the base path factored in.

i.e if the base path is set to '/Test/' I expect the root index page to navigate to '/Test/' and not '/'

Screenshots or Videos

No response

Platform

Chrome

Additional context

No response

@jasonbarry
Copy link

root is not honored either

@oedotme
Copy link
Owner

oedotme commented Oct 13, 2023

Hey @theixdev, as this mostly involve setting a custom basename in the router itself as well, I'd wouldn't expect it to work automatically. You'd need to set the router's basename prop along side Vite's base option.

Here's a comment about enabling base and basename with generouted, mentioned at #102

Hope that helps!

@oedotme
Copy link
Owner

oedotme commented Oct 13, 2023

@jasonbarry In general, there's a customization path if you need to follow a certain directory/project structure specially in non-js projects, here's an example of a custom routes definition + custom plugin options. Workspaces-based monorepos expected to work out-of-the-box though.

Could you provide an example of a setup with a custom root to have more context?

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

3 participants