Skip to content

Commit b3c7540

Browse files
authored
Update building instructions
1 parent 91ffdb0 commit b3c7540

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

content/docs/how-to-contribute.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,27 @@ First, run `yarn build`. This will produce pre-built bundles in `build` folder,
130130

131131
The easiest way to try your changes is to run `yarn build react/index,react-dom/index --type=UMD` and then open `fixtures/packaging/babel-standalone/dev.html`. This file already uses `react.development.js` from the `build` folder so it will pick up your changes.
132132

133-
If you want to try your changes in your existing React project, you may copy `build/dist/react.development.js`, `build/dist/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `yarn link` to point them to your local `build` folder:
133+
If you want to try your changes in your existing React project, you may copy `build/dist/react.development.js`, `build/dist/react-dom.development.js`, or any other build products into your app and use them instead of the stable version.
134+
135+
If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `yarn link` to point them to your local `build` folder. Note that **instead of `--type=UMD` you'll want to pass `--type=NODE` when building**. You'll also need to build the `scheduler` package:
134136

135137
```sh
136-
cd ~/path_to_your_react_clone/build/node_modules/react
138+
cd ~/path_to_your_react_clone/
139+
yarn build react/index,react-dom/index,scheduler --type=NODE
140+
141+
cd build/node_modules/react
137142
yarn link
138-
cd ~/path_to_your_react_clone/build/node_modules/react-dom
143+
cd build/node_modules/react-dom
139144
yarn link
140-
cd /path/to/your/project
145+
146+
cd ~/path/to/your/project
141147
yarn link react react-dom
142148
```
143149

144150
Every time you run `yarn build` in the React folder, the updated versions will appear in your project's `node_modules`. You can then rebuild your project to try your changes.
145151

152+
If some package is still missing (e.g. maybe you use `react-dom/server` in your project), you can always do a full build with `yarn build`. Note that running `yarn build` without options takes a long time.
153+
146154
We still require that your pull request contains unit tests for any new functionality. This way we can ensure that we don't break your code in the future.
147155

148156
### Style Guide {#style-guide}

0 commit comments

Comments
 (0)