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

Allow creating multiple router instances #148

Open
DellanX opened this issue Apr 5, 2023 · 2 comments
Open

Allow creating multiple router instances #148

DellanX opened this issue Apr 5, 2023 · 2 comments
Labels
✨ feature request a new feature request

Comments

@DellanX
Copy link

DellanX commented Apr 5, 2023

This package is amazing, though I think I may have a complicated use case to mess things up.

As of now, I have a laravel project with 3 subdomains, each has different routes available to them:

  1. core website with login and user management
  2. chat subdomain with pages for sending messages
  3. utility subdomain with pages for a user's calendar management.

I need to be able to generate different route configurations for the subdomains independent of each other.

Excess information

For the purpose of development, I used this plugin with routesFolder to populate all 3 sets on all 3 subdomains.
The issue is that the API doesn't serve routes outside of the subdomain. (e.g. calendar API doesn't work on chat pages).
Fine for development; however, for production a 404 should page appear instead.

What I'd prefer to be able to do, is add a route folder during runtime, so that each entry point only needs to add its specific routes.
Or even better, to be able to load this in the vite config somehow? (maybe through output.plugins?)

That being said, I can't imagine how this could be added to the output.plugins setting in a way that doesn't destructively merge.
As of now, if I try this, vite throws an error stating that vue-router/auto does not exist

@posva posva changed the title [Feature Request] Subdomain support? Allow creating multiple router instances Apr 5, 2023
@posva
Copy link
Owner

posva commented Apr 5, 2023

Thanks!

Maybe this could be possible by allowing the plugin to be instantiated multiple times and exposing each of them via different module vue-router/auto-1 etc

@DellanX
Copy link
Author

DellanX commented Apr 7, 2023

Oooo, yes that's actually a great idea in my opinion.

Though, preferably we'd be able to add an alias such as: "vue-router/auto-chat"

@settings settings bot removed the enhancement label Feb 21, 2024
@posva posva added ⚡️ enhancement improvement over an existing feature ✨ feature request a new feature request and removed ⚡️ enhancement improvement over an existing feature labels Feb 21, 2024
@posva posva moved this to 🆕 New in unplugin-vue-router May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature request a new feature request
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants