ok i finally found a solution for my actual proble...
# javascript
t
ok i finally found a solution for my actual problem: the dce step would remove some methods. I first thought the method is simply renamed so i tried to find out how to avoid the method is removed. But as @Robert Jaros pointed out, when using
@JsName
the method named isn;t mangled and indeed i can find some emthods from my code with the correct name in the resulting bundle. I thought configuring the terser plugin is the way to go, but didn't work out becasue the config in
webpack.config.d
is ignored. But then i found out: its indeed dce that removes the method! i tried
dceTask{keep{..}}
but couldn;'t make it work. No i finally figured: the methods removed reside in the default package. So the question is: is it a bug or a feature that you cannot
keep
a mthod from the default package?
m
You could try the new JS IR compiler. No DCE settings needed there. But code splitting becomes tricky.
js(IR) { … }
instead of
js { … }