File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ well. This is to ensure that when users download a published version from NPM,
23
23
they will be able to install all dependencies correctly without Bazel. It is the
24
24
responsibility of the developer to keep both ` package.json ` in sync.
25
25
26
+ ## Windows support
27
+
28
+ In general, any sort of node file lookup on Bazel should be subject to ` require.resolve ` .
29
+ This is how rules_nodejs resolves paths using the Bazel runfiles mechanism, where a given
30
+ Bazel target only has access to outputs from its dependencies.
31
+
32
+ In practice, this does not make a lot of difference on Linux.
33
+ A symlink forest is laid down where the target is going to actually run, and mostly the
34
+ files are resolved correctly whether you use ` require.resolve ` or not because the files are there.
35
+
36
+ On Windows though, that's a stricter. Bazel does not lay down a symlink forest on
37
+ windows by default. If you don't use ` require.resolve ` , it's still possible to correctly
38
+ resolve some files, like outputs from other rules. But other files, like node modules
39
+ dependencies and data files, need to be looked up in the runfiles.
40
+
41
+ Since the requirement is quite lax on Linux but quite strict on windows, what ends up
42
+ happening is that lack of ` require.resolve ` calls go unnoticed until someone tries to run
43
+ things on Windows, at which point it breaks.
44
+
26
45
## Issues
27
46
28
47
1 . Yarn workspaces is not compatible with Bazel-managed deps
You can’t perform that action at this time.
0 commit comments