title: Angular library import *
body: <p>So one of the modules that i use in my library is <code>sha256</code>. This has to be imported as such: </p>
  
  <pre><code>import sha256 from 'sha256';
  </code></pre>
  
  <p>Now I read on this SO question: 
  <a href="https://stackoverflow.com/questions/46876541/errors-when-using-momentjs-in-angular-typescript-library?rq=1">Errors when using MomentJS in Angular Typescript library</a></p>
  
  <p>That you need to do it differently when compiling: </p>
  
  <p>So at first, I changed it to: </p>
  
  <pre><code>import * as sha256_ from 'sha256';
  const sha256 = sha256_;
  </code></pre>
  
  <p>However these threw the same error: </p>
  
  <pre><code>ERROR: Cannot call a namespace ('sha256')
  An unhandled exception occurred: Cannot call a namespace ('sha256')
  </code></pre>
  
  <p>Then i tried to edit my <code>tsconfig.json</code>:</p>
  
  <pre><code>  "angularCompilerOptions": {
      "allowSyntheticDefaultImports": true,
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true
    }
  </code></pre>
  
  <p>However without any success.</p>
  
  <p>Can anyone tell me how I can correctly build my library with such an import?</p>
  
  <p><strong>Edit</strong> </p>
  
  <p>I also added it to the <code>compilerOptions</code>:</p>
  
  <pre><code>    "compilerOptions": {
      "outDir": "../../out-tsc/lib",
      "target": "es2015",
      "declaration": true,
      "inlineSources": true,
      "allowSyntheticDefaultImports": true,
      "types": [],
      "lib": [
        "dom",
        "es2018"
      ]
    },
  </code></pre>
  
  <p><strong>ng --version</strong></p>
  
  <pre><code>Angular CLI: 8.3.20
  Node: 10.16.0
  OS: win32 x64
  Angular: 8.2.14
  ... animations, common, compiler, compiler-cli, core, forms
  ... language-service, platform-browser, platform-browser-dynamic
  ... router
  
  Package                            Version
  ------------------------------------------------------------
  @angular-devkit/architect          0.803.20
  @angular-devkit/build-angular      0.803.20
  @angular-devkit/build-ng-packagr   0.803.20
  @angular-devkit/build-optimizer    0.803.20
  @angular-devkit/build-webpack      0.803.20
  @angular-devkit/core               8.3.20
  @angular-devkit/schematics         8.3.20
  @angular/cli                       8.3.20
  @ngtools/webpack                   8.3.20
  @schematics/angular                8.3.20
  @schematics/update                 0.803.20
  ng-packagr                         5.7.1
  rxjs                               6.4.0
  typescript                         3.5.3
  webpack                            4.39.2
  </code></pre>