I would suggest another solution, for the case you are writing or generating the required module.
In the required module, put the variables to be exported in the global object, instead of the exports:
const func1 = () = {console.log('func1');
const pi2 = 3.14;
global.func1 = func1;
global.pi2 = pi2;