Skip to content

Commit

Permalink
docs: note that root property should use __dirname (#2433)
Browse files Browse the repository at this point in the history
* docs: note that `root` property should use `__dirname`

* fix: formatting
  • Loading branch information
szymonrybczak authored Jun 27, 2024
1 parent ebbf215 commit 99d39a5
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/autolinking.md
Original file line number Diff line number Diff line change
@@ -135,12 +135,14 @@ We can leverage CLI configuration to make it "see" React Native libraries that a
module.exports = {
dependencies: {
'local-rn-library': {
root: '/root/libraries',
root: path.join(__dirname, '/path/to/local-rn-library'),
},
},
};
```

> Note: In the `root` field, it's recommended to use `__dirname` instead of `process.cwd()`. This ensures the path is consistently resolved, regardless of the current working directory.
## How can I use autolinking in a monorepo?

There is nothing extra you need to do - monorepos are supported by default.
2 changes: 1 addition & 1 deletion docs/projects.md
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ Another use-case would be supporting local libraries that are not discoverable f
module.exports = {
dependencies: {
'local-rn-library': {
root: '/root/libraries',
root: path.join(__dirname, '/path/to/library'),
},
},
};

0 comments on commit 99d39a5

Please sign in to comment.