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
I use "@/" as the path alias, and when packaging, the JS file in the product is normal. However, there is a missing "/" in the alias of the ".d.ts" file. For example, when I use "@/components/HelloWorld. vue", it should be converted to "./components/HelloWorld. vue", but in reality, it is converted to ". components/HelloWorld. vue"
@qmhc With this change configurations like: "paths": { "#*": [ "./src/*" ] }
wont work anymore, not fully sure if they worked before this change did not yet have time to test with older versions. Just thought to let you already know that this fix is not perfect, will try to find time to make a new reproduction and file a new bug later.
Did quick test with the reproduction in this issue with updated dts plugin to 3.7.0 and modified it to according above setup and imports to be #components* and the output was .components/* not ./components/* as it should be.
In our project with the #* configuration the plugin fails to completely replace the paths and they remain as #components/* in the output file. Have not yet figured out what is the difference with our project and the above reproduction, could be that we have multi project repo both vite and typescript config files are in subdirectory or its something else, will try to replicate this later and file a new bug as soon as I find time.
Our current setup uses vue-tsc + tsc-alias and that combination replaces the paths correctly, but would love to change to using this plugin.
Describe the bug
I use "@/" as the path alias, and when packaging, the JS file in the product is normal. However, there is a missing "/" in the alias of the ".d.ts" file. For example, when I use "@/components/HelloWorld. vue", it should be converted to "./components/HelloWorld. vue", but in reality, it is converted to ". components/HelloWorld. vue"
Reproduction
https://stackblitz.com/edit/vitejs-vite-ctrqsy?file=tsconfig.json,vite.config.ts,src%2Findex.ts
Steps to reproduce
System Info
Validations
The text was updated successfully, but these errors were encountered: