package.json -
"workspaces": [
"packages/*",
"samples/*"
],
"packageManager": "[email protected]"
I want to install and symlink the dependencies in samples but I don't want the yarn install to update the yarn.lock file. Is there a setting in workspaces or yarn to achieve this?
I think you want to use
yarn add your-package@"workspace:^"
(or otherworkspace:
ranges). This does end up in youryarn.lock
, but when publishing your package yarn will actually replace the dependency with a versioned dependency (depending on the range specifier). Also, it doesn't include any hash or anything in the yarn.lock, so you don't need to reinstall when changes are made to the package.