Good evening. maybe a stupid question but… . We’re developing a KMP library targeting JS (web) (and in the future android, etc). The JS target are published as npm packages on our registry. We use the npm-packages in a SPA (not nodeJs)
Now to my question, should JS target browser or nodejs? As I understand it, the DCE (threeshaking) is only used by the browser “target”. Using the DCE should result in smaller npm packages? Or?
09/04/2020, 1:15 AM
You actually don't need DCE to a lib that will be published to npm, Reason. You yet don't know what to treeshake in the first place