fix: removed source map comment from generated .d.ts code#72
fix: removed source map comment from generated .d.ts code#72I-Enderlord-I wants to merge 3 commits intosxzz:mainfrom
Conversation
commit: |
sxzz
left a comment
There was a problem hiding this comment.
Could you please add a unit test for it?
|
Technically there is one. I have no idea how it didn't fail before. (source-map.test.ts/tsc) |
|
Ok, after some playing around I found the following weird behavior: This is the export const foo: number = 42
type SomeType<T> = T
type FooType = string
interface Interface {}
export function fn(arg0: SomeType<FooType>, opt: Interface): void {}
export enum Enum {
A = 0,
B = 1,
C = 2,
}
export class Cls {
foo: string
fn(e: Enum): void {}
}When I compile this without my fix there is no second source map comment. As you see, this file includes 3 types that are not exported but still have to be included for the function fn, namely It seams the bug get resolved in some other way already, when there are non exported types in the |
|
Thanks for your PR, but I fixed it in 7ca1234 using a much more robust approach instead of a regex. |
Description
Removed superfluous source map URL comment from
.d.tscode generated by tsc. This fixes having two of them in the final declaration file chunk after rolldown adds it's own.Linked Issues
fixes #71
Additional context
The failing tests are from the main branch, not me.