You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two libs, one is @nrwl/node:lib and the other is @nrwl/js:lib. Both are buildable. Both use one external dependency, e.g. dayjs.
Now after I build both of them, the node lib has the dayjs listed as dependency in its generated package.json in the dist. But the js library does not.
Expected Behavior
The @nrwl/js:lib should list its external dependencies in the generated package.json in dist too, just like @nrwl/node:lib.
Steps to Reproduce
create a workspace with one @nrwl/node:lib and one @nrwl/js:lib
I am having the same issue. Both the @nrwl/js:tsc and @nrwl/js:swc build executors are not updating the dependencies in the dist/libs/X/package.json file.
@FrozenPandaz can you please confirm the expected behaviour?
Having dug into this a bit, it looks like updatePackageJson util in @nrwl/js should perhaps be using createPackageJson from @nrwl/workspace to create/update the package.json file.
The createPackageJson util updates the dependencies and devDependencies based on the ProjectGraph, and is currently used by @nrwl/node:build and @nrwl/next:build.
Update: This observation wasn't quite correct. It looks like the updateBuildableProjectPackageJsonDependencies is what should be used by the @nrwl/js:tsc and @nrwl/js:swc executors. I have created a PR for this change, see #9073
Current Behavior
I have two libs, one is @nrwl/node:lib and the other is @nrwl/js:lib. Both are buildable. Both use one external dependency, e.g. dayjs.
Now after I build both of them, the node lib has the dayjs listed as dependency in its generated package.json in the dist. But the js library does not.
Expected Behavior
The @nrwl/js:lib should list its external dependencies in the generated package.json in dist too, just like @nrwl/node:lib.
Steps to Reproduce
Repro repo:
https://github.com/ziacik/nx-bug-4
Environment
The text was updated successfully, but these errors were encountered: