The project reference for package-b is omitted from package-a as the version does not match.
Actual behaviour
The project reference for project-b is written into project-a regardless. When using Yarn Workspaces (and probably others), even though TS will have built the project reference, importing it actually uses the older version from node_modules/, so building is pointless.
Suggestion
When filtering the project references of project-a, check the package.json for both projects and ensure the version of project-b matches what is in project-a's package.json
Example
@scope/package-a@1.0.0
depends on@scope/package-b@1.0.0
, but the latest version ofpackage-b
in the monorepo is2.0.0
.Expected behaviour
The project reference for
package-b
is omitted frompackage-a
as the version does not match.Actual behaviour
The project reference for
project-b
is written intoproject-a
regardless. When using Yarn Workspaces (and probably others), even though TS will have built the project reference,import
ing it actually uses the older version fromnode_modules/
, so building is pointless.Suggestion
When filtering the project references of
project-a
, check thepackage.json
for both projects and ensure the version ofproject-b
matches what is inproject-a
'spackage.json
I am working on a PR for this now