-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dts doesn't resolve typescript paths on dts generation and wrong dts dist structure #19
Comments
The directory structure relative to If you want a fixed export entry, you can use the In your case, first you need to remove If you want to generate only a single declaration file in the end, I recommend |
I will add support for import types from |
Thanks for the fast answer, and the great advices. The generation is much better with the changes made in this commit also idk if is intended that @types is generated out but my playground still failing with the import at Thanks. |
There have some bugs, I open a new issue (#20) to track them. Now you can change your alias config: defineConfig({
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/components'),
'@': path.resolve(__dirname, 'src')
}
}
}) And use |
Hello I'm trying to generate the .d.ts for my vite vue lib, but at the time that i inspect my dist folder i identify 2 problems so far:
the .ts based .d.ts such as index.d.ts doesn't resolve correctly the typescript paths. eg. '@/' path. So module not found problem raises at the import and export of anything.
The dist folder gets the intended declaration dir (in my case @types/), but have an incorrect folder structure for d.ts of my components. like copying the src/ dir inside. This maybe works alongside a correr path resolution buy i have no clue about it.
i have no idea if I'm misunderstanding something, or i have a wrong configuration for proper generation of types of my lib, so any advice is appreciated
For reproduction :
The text was updated successfully, but these errors were encountered: