title: NodeJS import file with the same name as a folder
body: <p>I have the following file structure: ([] are folders)</p>
  <pre><code>[MySQL]
     ConnectionPool.ts
     Connection.ts
  MySQL.ts
  </code></pre>
  <p>In my code, I am using typescript to develop the app, which will be built to javascript for the production version. The development version is tested directly from the uncompiled typescript files, using babel with the following configurations:</p>
  <pre><code>{
      &quot;presets&quot;: [
          [&quot;@babel/preset-env&quot;, {
              &quot;targets&quot;: {
                  &quot;node&quot;: &quot;current&quot;
              }
          }], 
          &quot;@babel/preset-typescript&quot;
      ],
      &quot;plugins&quot;: [
          &quot;@babel/plugin-transform-runtime&quot;, 
          [
              &quot;module-resolver&quot;,
              {
                  &quot;alias&quot;: {
                      ... list of some aliases
                  }
              }
          ]
      ]
  }
  </code></pre>
  <p>My problem is the following, I do most of my imports like this:</p>
  <pre><code>import ConnectionPool from 'MySQL/ConnectionPool`
  </code></pre>
  <p>which works for me, as when I run my dev code, the compiler correctly identifies the file extension to <code>.ts</code>, and it also correctly identifies the built versions file extension to <code>.js</code>.</p>
  <p>But if I want to import my <code>MySQL.ts</code> file, I can't do it this way, as I will get the following error: <code>Error: Cannot find module './'</code>. If I specify in my import statement the file extension, everything works correctly, but then, when I build my code, there will be no more <code>.ts</code> files in there, so I will get errors there.</p>
  <p>Strangely, on the frontend, where I use <code>webpack</code>, I get no complaints about importing files without extension whose name is the same as a folders name in the same directory. What solutions do I have for this issue, which does not revolve around renaming my files or folders in the structure?</p>