You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This lets our generated nodejs_binary targets for npm packages express dynamic runtime-only dependencies
This is needed for example so that rollup binary can require the rollup-plugin-* packages
Copy file name to clipboardExpand all lines: packages/typescript/docs/install.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ managing npm dependencies with Bazel.
104
104
105
105
## Customizing the TypeScript compiler binary
106
106
107
-
An example is needing to increase the NodeJS heap size used for compilations.
107
+
An example use case is needing to increase the NodeJS heap size used for compilations.
108
108
109
109
Similar to above, you declare your own binary for running tsc_wrapped, e.g.:
110
110
@@ -127,7 +127,9 @@ nodejs_binary(
127
127
128
128
then refer to that target in the `compiler` attribute of your `ts_library` rule.
129
129
130
-
Another use case is to use [tsickle], which is an optional dependency of `tsc_wrapped`. In case it needs `"@npm//tsickle"` added to the `data` attribute above.
130
+
Note that `nodejs_binary` targets generated by `npm_install`/`yarn_install` can include data dependencies
131
+
on packages which aren't declared as dependencies. For example, if you use [tsickle] to generate Closure Compiler-compatible JS, then it needs to be a `data` dependency of `tsc_wrapped` so that it can be loaded at runtime.
132
+
See the `dynamic_deps` attribute of `npm_install`/`yarn_install` to include more such runtime dependencies in the generated `nodejs_binary` targets, rather than needing to define a custom one.
0 commit comments