transform-require-on-use
This is a babel transform that conceptually transforms this:
const module = ; { if condition module; }
into this:
const module = ; { if condition module; }
That's it!
Caveats
Modules with that have require-time side-effects will obviously not play well with this.
v1.0.0 is super naive, let's see where it goes.