-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Description
Command
build
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
~19.2.14
Description
In Angular 19.2.x, having a library project with multiple sub-packages (ng-package.json) for example 'mylib/core, when running ng build --watch and making changes on a source file of mylib/core, the cli proceeded to build not only mylib/core but their dependent subpackages in the same project. So it printed multiple:
Building entry point 'mylib/core'
One for each dependent subpackage. Now it only prints one in Angular 21.1.4, for mylib/core. As a consequence of this, when using nb build --watch the top level package.json version hash is not changed, and this cause problems in mono repos that are linking locally to this library, the ng serve of the client application of the library doesn't notice changes because the version has not changed
Minimal Reproduction
- Clone https://github.com/robmv/ng-build-watch-bug
- Build it using
ng build --watch - Record the output of
grep version dist/mylib/package.json - Edit the file
projects/mylib/core/src/public-api.ts, like modifying the value of the only constant defined there. - Notice the output of the build prints
Building entry point 'mylib/core'but only that subpackage, no for entry point 'mylib' - Compare the output of
grep version dist/mylib/package.jsonwith the previous recorded value. - In my installation the output is always the same value:
0.0.0-watch+1771439999045no matter what changes I make inside the core sub-package.
Exception or Error
Your Environment
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI : 21.1.4
Angular : 21.1.4
Node.js : 22.22.0
Package Manager : npm 10.9.4
Operating System : linux x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.1.4 │ ^21.1.4 │
│ @angular/cli │ 21.1.4 │ ^21.1.4 │
│ @angular/common │ 21.1.4 │ ^21.1.0 │
│ @angular/compiler │ 21.1.4 │ ^21.1.0 │
│ @angular/compiler-cli │ 21.1.4 │ ^21.1.0 │
│ @angular/core │ 21.1.4 │ ^21.1.0 │
│ @angular/forms │ 21.1.4 │ ^21.1.0 │
│ @angular/platform-browser │ 21.1.4 │ ^21.1.0 │
│ @angular/router │ 21.1.4 │ ^21.1.0 │
│ ng-packagr │ 21.1.0 │ ^21.1.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.0.18 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels