Skip to content

I've been using the ng build my-lib --watch for some time now but I 've been unhappy with the rebuild time. #17801

@sunildarji811

Description

@sunildarji811

I've been using the ng build my-lib --watch for some time now but I 've been unhappy with the rebuild time.
Today I changed the default path mapping in main project's tsconfig to point to lib's public_api:

"paths": {
      "users": [
        "projects/users/src/public_api"
      ],
      "shared": [
        "projects/shared/src/public_api"
      ]
    }

now the libraries are built by ng serve command, changes propagates super fast and also the Chrome devtools are able to debug raw typescript files.
Sounds too good to be true but really works.

Originally posted by @GeorgeKnap in #10643 (comment)

How to use one library project with another

After this changes how to resolve dependency if "shared" library is used inside "users" library.

Getting below error while ng build users

error TS6059: File '....projects/shared/src/lib/com-model.component.ts' is not under 'rootDir' '...\projects\users\src'. 'rootDir' is expected to contain all source files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions