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

Leverage vue-router alias/redirect #3

Open
manniL opened this issue Apr 25, 2018 · 2 comments · May be fixed by #37
Open

Leverage vue-router alias/redirect #3

manniL opened this issue Apr 25, 2018 · 2 comments · May be fixed by #37
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@manniL
Copy link
Member

manniL commented Apr 25, 2018

Currently, the module only works in universal mode, because a server middleware is used. A possible solution to make the module work in SPA and generate mode would be the alias/redirect options in the vue-router.

Related: #1
Read more

@manniL manniL added enhancement New feature or request help wanted Extra attention is needed labels Apr 25, 2018
@juno-yu
Copy link
Contributor

juno-yu commented Oct 17, 2018

looked into this a little bit

Ignoring this, I have made an implementation based on 'addplugin call in module' approach for a simple path that works in both matching merchanism (a redirect from /abc -> /about)
https://codesandbox.io/s/qkxvnmv104

In spa mode the redirection looks working as expected for dev / generated mode, including generating the page for '/abc' by adding it into options.generate.routes

In universal generate mode i encountered a blocker, that the redirection logic by server middleware seems not to be considered so '/abc' is unable to be resolved and generated finally
(while in universal dev mode both 1)a direct visit to '/abc' 2)clicking a router-link for '/abc' work as expected)

@manniL
Copy link
Member Author

manniL commented Oct 17, 2018

@juno-yu Thanks for the research!

I'd appreciate having spa redirect support in the module.

For generate you are right, the serverMiddleware isn't considered at all. Could we apply the idea from the spa version there and leverage the spa fallback mechanism of generate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants