How to dynamically execute/eval JavaScript code that contains an ES6 module / requires some dependencies?

I want my users to be able to use JavaScript as a scripting language inside my JavaScript application. In order to do so, I need to dynamically execute the source code. There seem to be two main …