title: Import typescript module Directory import is not supported
body: <p>I'm building my module under <code>src/index.ts</code> and compiling it with <code>node_modules/.bin/tsc --watch</code> the module it's a simple (I'm learing TS btw)</p>
  <pre><code>src/index.ts
  import * as fs from &quot;fs&quot;;
  
  class FileReader {
      private file: string;
      public path: string
      constructor(path: string) {
          this.path = path;
          this.file = this.readFile();
      }
  
      private readFile() : string {
          return fs.readFileSync(this.path,'utf8');
      }
  
  }
  
  
  export default FileReader;
  </code></pre>
  <pre><code>// read.js
  
  import FileReader from &quot;./dist&quot;;
  
  
  const a = new FileReader('./example.log');
  </code></pre>
  <p>my package.json looks like</p>
  <pre><code>{
    &quot;name&quot;: &quot;foo&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;bar&quot;,
    &quot;main&quot;: &quot;dist/index.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;
    },
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;git+https://github.com/foo/bar.git&quot;
    },
    &quot;keywords&quot;: [
      &quot;logs&quot;,
      &quot;json&quot;,
      &quot;typescript&quot;
    ],
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;devDependencies&quot;: {
      &quot;@types/node&quot;: &quot;^17.0.13&quot;,
      &quot;tslint&quot;: &quot;^6.1.3&quot;,
      &quot;typescript&quot;: &quot;^4.5.5&quot;
    },
    &quot;dependencies&quot;: {
      &quot;commander&quot;: &quot;^9.0.0&quot;
    },
    &quot;type&quot;: &quot;module&quot;
  }
  </code></pre>
  <p>So far the error I'm getting is</p>
  <pre><code>Directory import './dist' is not supported resolving ES modules imported from ./read.js
  </code></pre>
  <p>Can anyone explainme what im doing wrong?</p>
  <p>I'm trying to run my <code>read.js</code> like <code>node read.js</code></p>
  <p>Thanks in advance</p>