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
TypeScript has the behavior that if you run tsc a.ts and a.ts contains an import from ./b.ts, then that module is automatically included in the program and emitted.
This means that legacy builds might be configured to compile an "entry point" file, and then emit .js outputs for all reachable files. Non-reachable files might not correctly type-check and must not be included in the program.
Since ts_project currently requires an exhaustive list of srcs and expects outputs for each of these srcs, this is currently difficult to use. You'd be forced to run vanilla tsc instead, producing an output_dir which makes downstream usage of those outputs harder.
Instead we could imagine some tooling as part of a BUILD file generator that uses the TypeScript API to query the compiler for which srcs belong in a given program, then write these to the srcs list of the ts_project rule.
TypeScript has the behavior that if you run
tsc a.ts
anda.ts
contains an import from./b.ts
, then that module is automatically included in the program and emitted.This means that legacy builds might be configured to compile an "entry point" file, and then emit .js outputs for all reachable files. Non-reachable files might not correctly type-check and must not be included in the program.
Since
ts_project
currently requires an exhaustive list ofsrcs
and expects outputs for each of thesesrcs
, this is currently difficult to use. You'd be forced to run vanillatsc
instead, producing anoutput_dir
which makes downstream usage of those outputs harder.Instead we could imagine some tooling as part of a BUILD file generator that uses the TypeScript API to query the compiler for which srcs belong in a given program, then write these to the
srcs
list of the ts_project rule.Note I have some WIP for this over here: https://github.com/stackb/bzl-configure/blob/master/src/plugin_ts_project.ts
The text was updated successfully, but these errors were encountered: