Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit 93397b9

Browse files
committed
feat(docs): add monorepo instructions
1 parent f5e23d4 commit 93397b9

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Usage in monorepo
3+
route: /docs/usage-in-monorepo
4+
parent: Documentation
5+
menu: General
6+
---
7+
8+
# Implementing in monorepo
9+
10+
When installing Docz in a monorepo environment you might need some extra steps to get everything working correctly.
11+
12+
Let's say we have a lerna monorepo with workspaces defines as: `packages/**/*`, in a folder structure it would look like this:
13+
14+
```
15+
packages
16+
|_ components
17+
|_ portal
18+
|___ package.json
19+
```
20+
21+
Docz and @foo/component would be a dependency in `portal/package.json`. As Docz copies over this package.json to `portal/.docz/package.json`
22+
you might run into `error There are more than one workspace with name "@foo/portal"`. In order to fix this add
23+
a couple lines to your `portal/package.json`:
24+
25+
```
26+
//portal.package.json
27+
{
28+
"private": true,
29+
"workspaces": [
30+
// needed to resolve @foo/components in portal/package.json
31+
"../../packages/**/*",
32+
// needed to resolve @foo/components in portal/.docz/package.json
33+
"../../../packages/**/*"
34+
]
35+
}
36+
```
37+
38+
You might need to tweak these paths to match your monorepo structure

0 commit comments

Comments
 (0)