Closed ouuan closed 2 years ago
Thanks for reporting!
Probably encoded by routes.resolve
here.
Using decodeURIComponent
when obtaining the outputFilename
should fix it, and pathToFilename
is probably the best place to do that.
PRs are welcome, otherwise I'll take a look during the weekend.
I'm not sure how to handle the slash character 🤔 It seems that the slash should be encoded.
Perhaps path.split('/').map(decodeURIComponent).join('/')
?
Otherwise, it might be a good idea to use some of the encoding utilities already available in vue-router
.
iles
andvite
.Description 📖
The file names of dynamic routes are URI-encoded in the build output which breaks the links.
Reproduction 🐞
https://github.com/ouuan/iles-uri-encoding-broken-link-demo
The build outputs:
Here
foo%20bar
is generated from a dynamic route, andstatic foo bar
is a static route./foo bar
breaks, and we need to access it via/foo%2520bar
.