Force Hoisting Of Package Dependencies In Yarn (v1) Workspace
Asked Answered
B

0

8

I have a monorepo containing many packages. It is using yarn(v1) workspaces. One of the packages contains a set of development dependencies (packages/example-dev/@example/dev) that are consumed as a package by applications external to the monorepo. I would also like these dependencies to be available to the monorepo root. However, they are not hoisted (presumably because they are not shared with any other packages).

Is there any way to force the hoisting of packages in the package.json of my @example/dev to the workspace root?

Note that I don't want to redeclare all the dev dependencies in the root.

Buddy answered 12/10, 2020 at 15:20 Comment(1)
Not quite sure it is possible but maybe a different approach would be to inherit common package.json snippets. There is a nice tool for that: github.com/microsoft/package-inheritBevins

© 2022 - 2024 — McMap. All rights reserved.