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'm expecting tsup & dts to not change my alias declarations name like import type { X as Y } from "@package"; but it seems like it does indeed remove them. Leading to problem in build types. Is this expected ?
I'm declaring my types namespace in src/test.ts. Info: I'm importing my external package like so import type { PartialDeep as PartialDeepPrimitive } from "type-fest";
It compiles in dist/esm/test.d.ts. Info: The import get transformed to import { PartialDeep } from 'type-fest'; and thus exporting that way in my namespace: type PartialDeep<T> = PartialDeep<T>; which is a problem I'm assuming - it seems like it produces a sort of type loop.
When using the builded files in src/index.ts, types.PartialDeep logically resolves to any.
Can someone explain why it does this and if I can fix this quickly with a param or if this is just an actual issue ?
Thanks :)
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
sshmaxime
changed the title
import type { X as Y } from "@package; - Import alias doesn't get build properly and get lostimport type { X as Y } from "@package"; - Import alias doesn't get build properly and get lost
Aug 12, 2024
I'm expecting
tsup
&dts
to not change my alias declarations name likeimport type { X as Y } from "@package";
but it seems like it does indeed remove them. Leading to problem in build types. Is this expected ?Explanations:
Codesandbox
I'm declaring my
types
namespace insrc/test.ts
.Info: I'm importing my external package like so
import type { PartialDeep as PartialDeepPrimitive } from "type-fest";
It compiles in
dist/esm/test.d.ts
.Info: The import get transformed to
import { PartialDeep } from 'type-fest';
and thus exporting that way in my namespace:type PartialDeep<T> = PartialDeep<T>;
which is a problem I'm assuming - it seems like it produces a sort of type loop.When using the builded files in
src/index.ts
,types.PartialDeep
logically resolves to any.Can someone explain why it does this and if I can fix this quickly with a param or if this is just an actual issue ?
Thanks :)
Upvote & Fund
The text was updated successfully, but these errors were encountered: