0

my project like this

my-project
│
├─ node_modules *
├─ packages
│  ├─ a
│  │  └─ package.json
│  └─ b
│     └─ package.json
├─ package.json

In a's and b's package.json, I set their name "@mono/a" and "@mono/b",

how can I get a symlink @mono in my project's node_modules(the *), I've created and edited the pnpm-workspace.yaml file.

1 Answers1

0

If you want to add @mono/a to the dependencies of @mono/b, you can run:

pnpm --filter=@mono/b add @mono/a

Or alternatively, you can change directory to packages/b and run:

pnpm add @mono/a

It will add this to the package.json of @mono/b:

{
  "name": "@mono/b",
  "version": "1.0.0",
  "dependencies": {
    "@mono/a": "workspace:*"
  }
}

You can read more about the pnpm workspace here.

Zoltan Kochan
  • 5,180
  • 29
  • 38