You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Sorry if this was asked/answered before, just cannot find information on this topic)
When building a simple project, I get dist/index.html file with relative paths using parent directories navigation (double dots). It looks like this:
Seems to be happening when navigating to a subdirectory of the main drive C: from the default Windows terminal, cmd and building the project from there. (see the reproduction steps)
The vite.config has the option base: '' or base: './'.
What is expected is the relative paths with only the initial dot, like
This expected result seems to be achieved when creating a project in the C: drive directly with npm create vue@latest.
The problem seems to be related to the method of reaching the target directory, though not sure about the exact explanation.
I'd say if you go with cmd.exe /k cd [path] the index.html ends with parent folders paths and if you enter into directories one by one, the relative paths start with ./.
Again, sorry for duplication, surely it happened to someone else, but I just cannot formulate the search request in Google or here in Issues to find an adequate solution. Or if it's not vite related, if you point me to the possible solution it would be greatly appreciated.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
(Sorry if this was asked/answered before, just cannot find information on this topic)
When building a simple project, I get
dist/index.html
file with relative paths using parent directories navigation (double dots). It looks like this:Seems to be happening when navigating to a subdirectory of the main drive
C:
from the default Windows terminal,cmd
and building the project from there. (see the reproduction steps)The
vite.config
has the optionbase: ''
orbase: './'
.What is expected is the relative paths with only the initial dot, like
This expected result seems to be achieved when creating a project in the
C:
drive directly withnpm create vue@latest
.The problem seems to be related to the method of reaching the target directory, though not sure about the exact explanation.
I'd say if you go with
cmd.exe /k cd [path]
theindex.html
ends with parent folders paths and if you enter into directories one by one, the relative paths start with./
.Again, sorry for duplication, surely it happened to someone else, but I just cannot formulate the search request in Google or here in Issues to find an adequate solution. Or if it's not vite related, if you point me to the possible solution it would be greatly appreciated.
Reproduction
https://stackblitz.com/edit/vitejs-vite-dnt7jk
Steps to reproduce
C:\a
foldercmd /k cd c:\a
npm install & npm run build
dist/index.html
in a text editor and see the relative paths contain parent folders navigation (../
)System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: