Use case for absolute URL #2526
Unanswered
oleole39
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on a package for a Vue 3 app which first sets a
baseUrl
which is then in particular used byvue-router
.For that purpose, I am looking for a way to script the baseUrl change without rebuilding the app. I can have this to mostly work using
sed
in the built app's directory. However having only the path to search for instead of the full URL makes it prone to unlegitimate replacements (e.g. if baseUrl was initially"/"
or"/a/"
, etc.). I wouldn't encounter this issue if I could search for strings such ashttps://mydomain.tld/
orhttps://mydomain.tld/a/
instead.So currently, if I initially build the app using a full URL, I understand that this is
vite
which transforms the URLhttps://mydomain.tld/mypath/
into just a path/mypath/
, as mentioned in the doc:when I understand from
vue-router
's doc that it does not support full URL asbase
parameter:Doing so, the app eventually mostly works but the URL rewrite is poor, which I guess is related to
vue-router
.Would you think of a better way to change baseUrl after compilation?
I understand from this old answer of @posva (vuejs/vue-router#2927) that full URL input support was/is deemed useless so far (although I don't get whether it is by principle a minimalist standpoint or whether it would implies changing the whole code approach), but here is one use case (maybe a bit "edgy") where it would be useful.
Beta Was this translation helpful? Give feedback.
All reactions