This is a babel transform that conceptually transforms this:
const module = require("module");
function somewhere () {
if (condition) {
module.doSomething();
}
}
into this:
const module = () => require("module");
function somewhere () {
if (condition) {
module().doSomething();
}
}
That's it!
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.