Hey! We've been using this plugin happily for quite some time and never had any issues, so first of all thanks a lot!
Now, we are migrating away from using barrel files for imports, so converting things like
import type { Foo } from "$types" to
import type { Foo } from "$types/someStuff".
Now, in the IDE that works well and paths are resolved correctly, but after building in library mode and emitting .d.ts files with vite-plugin-dts, some paths are not resolved at all. As shown in this reproduction repo on stackblitz, importing from a barrel file (that just re-exports) works, but importing directly does not - the path alias is not changed.
So
import type { Foo } from "$types"
// becomes
import type { Foo } from "../types";
but
import type { Foo } from "$types"
// stays the same
import type { Foo } from '$types/someStuff';
The reproduction builds a react library in rollup lib mode, but it's the same for non-react apps, I tested.
Now, I am a bit unsure if this is an issue of this plugin, vite-plugin-dts or just my config, but after some research I think I'm at the right place here.
Hey! We've been using this plugin happily for quite some time and never had any issues, so first of all thanks a lot!
Now, we are migrating away from using barrel files for imports, so converting things like
import type { Foo } from "$types"
toimport type { Foo } from "$types/someStuff"
.Now, in the IDE that works well and paths are resolved correctly, but after building in library mode and emitting
.d.ts
files withvite-plugin-dts
, some paths are not resolved at all. As shown in this reproduction repo on stackblitz, importing from a barrel file (that just re-exports) works, but importing directly does not - the path alias is not changed.So
but
The reproduction builds a react library in rollup lib mode, but it's the same for non-react apps, I tested.
Now, I am a bit unsure if this is an issue of this plugin,
vite-plugin-dts
or just my config, but after some research I think I'm at the right place here.Please let me know if you need more details!