title: Convert import() to synchronous
body: <p>I'm trying to convert all of my node <code>require()</code>s into the <code>import()</code> statements, however, those are async and I'm having a bit of trouble.</p>
  
  <p>Right now I have:</p>
  
  <pre><code>import * as fs from 'fs';
  
  const paths = fs.readdirSync('./src/modules').map(path =&gt; './modules/' + path.slice(0, path.length - 3));
  
  const classes = [];
  
  paths.forEach(path =&gt; {
      let bClass = require(path);
  
      try {
          classes.push(new bClass.default());
      }
      catch (err) {
          //Here for if no default import
      }
  });
  </code></pre>
  
  <p>and want to convert that <code>require(path)</code> part into an <code>import()</code> but still want to keep it synchronous, is that possible? If it is, how would I got about it?</p>
  
  <p>Edit: a little more context. I have a list of modules that we want to import, and we're doing it this way so if something bugs out with one module we can just comment it out / remove it and not have to recode everything else. I just need dynamic synchronous imports without using <code>require()</code>.</p>