-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Rollup Version
v4.44.0
Operating System (or Browser)
macOS
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
All of these should treeshake, like they do when treeshake
is set to "smallest".
class TestClassA {
static one = 1;
static two = 1;
}
class TestClassB {
static {
this.one = 1;
}
static {
this.two = 2;
}
}
class TestClassC {
static {
this.one = 1;
this.two = 2;
}
}
Actual Behaviour
Only TestClassA
is removed.
class TestClassB {
static {
this.one = 1;
}
static {
this.two = 2;
}
}
class TestClassC {
static {
this.one = 1;
this.two = 2;
}
}
This is getting more common since TypeScript emits using static init blocks when targeting ES2022+ like here.
andygup and maxpatiiuk