I use react nwb toolkit for my lib, I also uses UMD bundles.
So for UMD bundle size optimize, I inject one of components through "script" tag, and this injecting needed only when use the UMD bundle, because in normal lib this lib comes from dependencies.
How I can do this? May be there is some "process" variable, which will "say" it's a UMD build.
Solution:
umd.js (umd bundle handler)
index.js (module bundle handler)
component.js