Skip to content

Ng serve does not rebuild after changes in library referenced in tsconfig paths #31380

@antoine-carruana

Description

@antoine-carruana

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

18.2.12

Description

Hi,

I have recently migrated from an angular 18 project to the 20 version.

I have a custom library and an app. To gain time and avoid multiple builds and having to build both the lib and the app I have referenced the lib (which is a dependency in the app) with paths to the local project in the tsconfig of the app.

When doing this, I referenced my public_api.ts and doing so, I don't have to build watch the library, any changes made in the library is automatically picked up by the serve of the app and a rebuild is done as if it was a change in the app.

Doing the same thing in angular 20 does not work, I have made some researchand read somewhere that the paths cannot react if it's not in the same workspace.

Should we not have a property somewhere to activate this ?

I have recreated a small lib and small app in angular 18 it works, in angular 20 I cannot manage to make it happen.

Thank you in advance

Regards

Minimal Reproduction

Create a lib in a folder
Create an app in another folder
Install the lib as a dependency in the app
In the tsconfig add a path property and reference the multiple public_api.ts of your lib

Exception or Error


Your Environment

Angular CLI: 18.2.12
Node: 22.17.0
Package Manager: npm 11.6.0
OS: win32 x64

Angular: 18.2.12
... build, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.12
@angular-devkit/build-angular   18.2.12
@angular-devkit/core            18.2.12
@angular-devkit/schematics      18.2.12
@schematics/angular             18.2.12
ng-packagr                      18.2.1
rxjs                            7.8.1
typescript                      5.5.2
zone.js                         0.14.10

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions