Closed manniL closed 1 month ago
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)
@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
?
Closing, as the module will remain in maintenance only.
Currently, the module only works in
universal mode
, because aserver middleware
is used. A possible solution to make the module work in SPA and generate mode would be thealias/redirect
options in the vue-router.Related: #1 Read more