When compiling with the typescript compiler (tsc), how class fields are transformed depends on the value of useDefineForClassFields, but the tsup is currently ignoring this setting.
This causes problems with field decorators.
Original typescript code:
export class Foo {
@customDecorator()
public readonly value!: string;
}
Result of tsc with useDefineForClassFields = false
When compiling with the typescript compiler (
tsc
), how class fields are transformed depends on the value ofuseDefineForClassFields
, but thetsup
is currently ignoring this setting.This causes problems with field decorators.
Original typescript code:
Result of
tsc
withuseDefineForClassFields = false
Result of
tsc
withuseDefineForClassFields = true
Result of
tsup
regardless ofuseDefineForClassFields
valueThe issue here is that the
__publicField()
logic which is being added, prevents processing of field decorators.Upvote & Fund