title: How to export a submodule in a Typescript library
body: <p>So my goal is to create a library in Typescript. My intention is to split up core parts of the library into submodules like RxJS or Angular Material.</p>
  
  <p>RxJS and Angular both support imports like so:</p>
  
  <pre><code>// RxJS
  import { map, filter } from 'rxjs/operators';
  
  // Angular
  import { MatButtonModule } from '@angular/material/button';
  </code></pre>
  
  <p>However, I am unable to replicate this myself.</p>
  
  <p>My goal is to do something similar and allow you to import a class with <code>import { foo } from 'package/bar</code>;</p>
  
  <p>I have looked at RxJS's source on Github and have tried replicating what they've done but it's not working.</p>
  
  <p>The library compiles fine but when I go about importing it I always get a <code>Cannot resolve dependency 'package/foo'</code> error.
  Meanwhile doing <code>import { test } from package</code> (without the submodule part) works completely fine.</p>
  
  <p>I've tried using paths in tsconfig to no avail. If that is the answer then I'm doing it wrong.</p>
  
  <p>How do I go about doing this?</p>