title: ES6 dynamic imports and instanciation of classes
body: <p>I'm trying to figure out how to perform dynamic import of classes in ES6 one the server side (node.js with Babel). 
  I would like to have some functionalities similar to what reflection offers in Java. The idea is to import all the classes in a specific folder and instanciate them dynamically.</p>
  
  <p>So for example  I could have multiple classes declared in a folder like the one below : </p>
  
  <pre><code>export default class MyClass {
  
     constructor(somevar) {
         this._somevar = somevar
     }
  
     //...
     //some more instance level functions here
  }
  </code></pre>
  
  <p>and then somewhere else in my app's code I could have a function that finds out all the classes in a specific folder and tries to instanciate them  :</p>
  
  <pre><code>//somewhere else in my app
  instanciationFunction(){
  
     //find all the classes in a specific folder
     var classFiles = glob.sync(p + '/path_to_classes/**/*.js', {
         nodir: true
     });
  
     _.each(classFiles, async function (file) {
         console.log(file);
  
         var TheClass = import(file);
         var instance = new TheClass();
  
         //and then do whatever I want with that new instance
  
     });
  }
  </code></pre>
  
  <p>I've tried doing it with require but I get errors. Apparently the constructor cant be found.</p>
  
  <p>Any idea would be greatly appreciated. </p>
  
  <p>Thanks</p>