Skip to content

Commit a981911

Browse files
committed
Mention yarn linking in contributing guide to run local npm packages
Unlike Ruby gems, Node packages can use multiple versions of the same package. Linking is needed to tell Node to use the same local package for all instances of a dependency. [skip ci]
1 parent 2a32c4b commit a981911

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

guides/source/contributing_to_ruby_on_rails.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ $ bundle exec rails new ~/my-test-app --dev
236236
The application generated in `~/my-test-app` runs against your local branch
237237
and, in particular, sees any modifications upon server reboot.
238238

239+
For JavaScript packages, you can use [`yarn link`](https://yarnpkg.com/cli/link) to source your local branch in a generated application:
240+
241+
```bash
242+
$ cd rails/activestorage
243+
$ yarn link
244+
$ cd ~/my-test-app
245+
$ yarn link "@rails/activestorage"
246+
```
247+
239248
### Write Your Code
240249

241250
Now get busy and add/edit code. You're on your branch now, so you can write whatever you want (make sure you're on the right branch with `git branch -a`). But if you're planning to submit your change back for inclusion in Rails, keep a few things in mind:

0 commit comments

Comments
 (0)