Skip to content

Commit 79c5671

Browse files
committed
Fix docs
1 parent ad678b4 commit 79c5671

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

docs/use_execroot_entry_point.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# use_execroot_entry_point
22

3-
This page describes the `use_execroot_entry_point` option on `js_run_binary` and
4-
`js_run_devserver`, and provides guidance on when to use each value.
3+
This page describes the `use_execroot_entry_point` option on `js_run_binary`
4+
and provides guidance on when to use each value.
55

66
## Background
77

@@ -32,10 +32,8 @@ the target configuration and land in the target-platform bin directory. The
3232
entry point used is the one in that output tree (the "execroot entry point"),
3333
rather than the copy inside the runfiles symlink tree. With everything
3434
consolidated in `bazel-out/<target-cfg>/bin/`, Node.js sees a single
35-
`node_modules` tree. This is the right choice for Next.js for two reasons:
36-
Next.js expects its inputs and outputs to be in the same directory tree, and it
37-
performs pre-rendering during the build, which involves running target-platform
38-
code on the exec platform.
35+
`node_modules` tree. This can be the right choice for some frameworks such as
36+
Next.js, which expects inputs and outputs to be in the same directory tree.
3937

4038
The tradeoff is that if the exec platform differs from the target platform (for
4139
example, cross-compiling from macOS to Linux), target-platform artifacts such as
@@ -55,10 +53,10 @@ runfiles resolution.
5553
## Recommendation
5654

5755
We recommend setting `use_execroot_entry_point = False` wherever possible and
58-
ensuring that all code executed during the build is declared as a dep of the
59-
`js_binary`. The main exception is Next.js and similar frameworks that expect
60-
inputs and outputs in the same directory tree or that execute target-platform
61-
code during the build, in which case `True` is required.
56+
ensuring that all code executed during the build is declared as a dependency of
57+
the `js_binary`. The main exception is Next.js and similar frameworks that
58+
expect inputs and outputs in the same directory tree or that execute
59+
target-platform code during the build, in which case `True` is required.
6260

6361
To disable `use_execroot_entry_point` globally, pass the build flag:
6462

0 commit comments

Comments
 (0)