nx
nx copied to clipboard
Yarn resolutions are not being picked up by generatePackageJson flag
Current Behavior
If there are packages listed in the resolutions field and the project would implicitly use those dependencies, the generated package.json should include the resolution.
Ex: myPackage is a devDepencdency and it has yourPackage v1.0.0 as a dependency. You list in the package.json resolution to use "yourPackage: 1.0.1". This resolution never makes it to the generated package.json
Expected Behavior
The resolution should be included in the package.json
Steps to Reproduce
Add to resolutions in package.json a higher version of an implicit dependency. Run the project build for one that has the generatepackagejson flag as true
Failure Logs
Environment
All
We are facing the same issue.
The only ugly workaround so far is to write a script that adds resolutions to final package.json after generation
Btw, this issue is not related to react so you can remove scope:react
Yeah , I am facing this issue also . I agreed, the only solution right now is to add resolutions to final package.json. which is fine but the issue is we have to copy the unnecessary dependencies due to this. resolutions field in root folder contains all resolutions for different applications. What if I want to include resolutions which are specific to application.
Ideally we need a script which will strip down the yarn.lock from root folder and copy it to dist/apps/appfolder and update generated package.json with application specific resolutions.
👍 for this, would be helpful for me as well
any workarounds?
Yeah same, any workarounds?
Please check with the latest version, as this should be fixed by parsing the source lock file.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.