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
We have modules managed in a pnpm monorepo which reference each other and which can be published to npmjs and referenced successfully. However, for local development we would like to have a version of an npm project which would normally consume our package via npmjs, but which is linked directly to the package in its pnpm workspace.
We hope in this way we can iterate on development more rapidly to prove changes before making a release, then just bump the proven version in the npm project to pull that release in.
I have tried various likely combinations of pnpm link, npm link running from within the relevant folders. However, so far i can't find a configuration which resolves local paths correctly.
Is there a standard way to approach this (e.g. use pnpm link --global from the package.json folder of @scope/packagename under development, then use npm link @scope/packagename from the folder of the consuming package - this doesn't work by the way).
Constraints
We are limited to stable versions of npm@6 and pnpm@6 if that makes a difference. The contents of the release is just the source of the package (there is no build step).
The consuming package depends on a named package from within the pnpm workspace, and in turn that package references a second package also within the pnpm workspace. I speculated that we needed to link both of them independently but perhaps there is a better model.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have modules managed in a
pnpm
monorepo which reference each other and which can be published to npmjs and referenced successfully. However, for local development we would like to have a version of annpm
project which would normally consume our package via npmjs, but which is linked directly to the package in its pnpm workspace.We hope in this way we can iterate on development more rapidly to prove changes before making a release, then just bump the proven version in the
npm
project to pull that release in.I have tried various likely combinations of
pnpm link
,npm link
running from within the relevant folders. However, so far i can't find a configuration which resolves local paths correctly.Is there a standard way to approach this (e.g. use
pnpm link --global
from thepackage.json
folder of@scope/packagename
under development, then usenpm link @scope/packagename
from the folder of the consuming package - this doesn't work by the way).Constraints
We are limited to stable versions of npm@6 and pnpm@6 if that makes a difference. The contents of the release is just the source of the package (there is no build step).
The consuming package depends on a named package from within the pnpm workspace, and in turn that package references a second package also within the pnpm workspace. I speculated that we needed to
link
both of them independently but perhaps there is a better model.Beta Was this translation helpful? Give feedback.
All reactions