title: Angular - import module between two libraries
body: <p>I created two libries with <a href="https://angular.io/guide/creating-libraries" rel="nofollow noreferrer">this</a> tutorial:</p>
  
  <p><code>ng new my-library --create-application=false
   ng generate library core
   ng generate library shared</code></p>
  
  <p>I would like to import CoreModule to SharedModule:</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { CoreModule } from '???';
  
  
  @NgModule({
    declarations: [],
    imports: [
      CoreModule
    ],
    exports: []
  })
  export class SharedModule { }
  </code></pre>
  
  <p>In CoreModule is public-api.ts:</p>
  
  <pre><code>export * from './lib/core.module';
  </code></pre>
  
  <p>I tried edit projects/shared/tsconfig.lib.json:</p>
  
  <pre><code>"paths": {
        "library/core": ["../../dist/core/"],
      }
  </code></pre>
  
  <p>But when I run <code>ng build shared</code>: </p>
  
  <blockquote>
    <p>ERROR: projects/shared/src/lib/shared.module.ts(2,32): error TS2307: Cannot find module 'library/core'.
    projects/shared/src/lib/shared.module.ts(8,5): error TS2304: Cannot find name 'CoreModule'.</p>
  </blockquote>
  
  <p>What is right way to import modules between two libraries in the same workspace? Thanks</p>
  
  <p>EDIT: tsconfig.json:</p>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "downlevelIteration": true,
      "experimentalDecorators": true,
      "module": "esnext",
      "moduleResolution": "node",
      "importHelpers": true,
      "target": "es2015",
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2018",
        "dom"
      ],
      "paths": {
        "core": [
          "dist/core"
        ],
        "core/*": [
          "dist/core/*"
        ],
        "shared": [
          "dist/shared"
        ],
        "shared/*": [
          "dist/shared/*"
        ]
      }
    },
    "angularCompilerOptions": {
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true
    }
  }
  </code></pre>
  
  <p>core library tsconfig.lib.json:</p>
  
  <pre><code>{
    "extends": "../../tsconfig.json",
    "compilerOptions": {
      "outDir": "../../out-tsc/lib",
      "target": "es2015",
      "declaration": true,
      "inlineSources": true,
      "types": [],
      "lib": [
        "dom",
        "es2018"
      ]
    },
    "angularCompilerOptions": {
      "annotateForClosureCompiler": true,
      "skipTemplateCodegen": true,
      "strictMetadataEmit": true,
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true,
      "enableResourceInlining": true
    },
    "exclude": [
      "src/test.ts",
      "**/*.spec.ts"
    ]
  }
  </code></pre>
  
  <p>shared library tsconfig.lib.json</p>
  
  <pre><code>{
    "extends": "../../tsconfig.json",
    "compilerOptions": {
      "outDir": "../../out-tsc/lib",
      "target": "es2015",
      "declaration": true,
      "inlineSources": true,
      "types": [],
      "lib": [
        "dom",
        "es2018"
      ]
    },
    "angularCompilerOptions": {
      "annotateForClosureCompiler": true,
      "skipTemplateCodegen": true,
      "strictMetadataEmit": true,
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true,
      "enableResourceInlining": true,
  
    },
    "exclude": [
      "src/test.ts",
      "**/*.spec.ts"
    ]
  }
  </code></pre>