title: How to split a typescript package into multiple submodules?
body: <p>My newest typescript project is split into <strong>different modules and submodules</strong>.</p>
  <p>My file structure:</p>
  <pre><code>package.json
  (...)
  /src
  | /module1
  | | index.ts
  | | (...)
  | | /subModule1
  | | | index.ts
  | | | (...)
  | | /subModule2
  |   | index.ts
  |   | (...)
  | /module2
    | index.ts
    | (...)
  </code></pre>
  <p>Every (sub)module has a <code>index.ts</code> file holding the module's exports.</p>
  <p>Now I finally want to publish my package. One should be able to import stuff from the
  modules in the following way:</p>
  <pre class="lang-js prettyprint-override"><code>import { A } from &quot;package/module1&quot;;
  import { B, C } from &quot;package/module1/subModule2&quot;;
  </code></pre>
  <p>I've already used this syntax on importing stuff from other packages on npm. But I can't find any explanations on how to implement such behavior. I've found some article explaining it for multiple files, but not for multiple modules structured in folders and subfolders.</p>