@@ -30,6 +30,7 @@ file a new issue.
3030 * [ Building the documentation] ( #building-the-documentation )
3131 * [ Building a debug build] ( #building-a-debug-build )
3232 * [ Building an ASAN build] ( #building-an-asan-build )
33+ * [ Speeding up frequent rebuilds when developing] ( #speeding-up-frequent-rebuilds-when-developing )
3334 * [ Troubleshooting Unix and macOS builds] ( #troubleshooting-unix-and-macos-builds )
3435 * [ Windows] ( #windows )
3536 * [ Prerequisites] ( #prerequisites )
@@ -527,6 +528,29 @@ $ ./configure --debug --enable-asan && make -j4
527528$ make test-only
528529```
529530
531+ #### Speeding up frequent rebuilds when developing
532+
533+ If you plan to frequently rebuild Node.js, especially if using several branches,
534+ installing ` ccache ` can help to greatly reduce build times. Set up with:
535+ ``` console
536+ $ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
537+ $ ccache -o cache_dir=< tmp_dir>
538+ $ ccache -o max_size=5.0G
539+ $ export CC=" ccache gcc" # add to your .profile
540+ $ export CXX=" ccache g++" # add to your .profile
541+ ```
542+ This will allow for near-instantaneous rebuilds even when switching branches.
543+
544+ When modifying only the JS layer in ` lib ` , it is possible to externally load it
545+ without modifying the executable:
546+ ``` console
547+ $ ./configure --node-builtin-modules-path $( pwd)
548+ ```
549+ The resulting binary won't include any JS files and will try to load them from
550+ the specified directory. The JS debugger of Visual Studio Code supports this
551+ configuration since the November 2020 version and allows for setting
552+ breakpoints.
553+
530554#### Troubleshooting Unix and macOS builds
531555
532556Stale builds can sometimes result in ` file not found ` errors while building.
0 commit comments