[ts_project] Windows outDir workaround causes error when used with generated tsconfig, due to target name generation #2884
Labels
Can Close?
We will close this in 30 days if there is no further activity
🐞 bug report
Affected Rule
ts_project
Is this a regression?
n/a
Description
When running on Windows, in order to use project references between
ts_project
rules without issues, the docs recommend the following workaround:This works when the
outDir
config is manually written into thetsconfig.json
file referred to by thets_project
rule, but not when thetsconfig.json
file is generated by thets_project
rule using the rule attributes.E.g.
works
but
errors with
This is important for us as we need project references to work properly, but don't want to check in tsconfig files with boilerplate.
This error seems to be caused by
ts_project
declaring outputs by joining theoutDir
attribute with the src file names:For now I am working around this by patching ts_project.bzl to comment out the following:
This causes the
tsconfig.compilerOptions.outDir
attribute not to influence the above code, while still allowing it to flow through to the generated tsconfig file.I don't know what a proper fix would look like.
🔬 Minimal Reproduction
https://github.com/matthewjh/rules_nodejs/tree/outdir_generated_tsconfig_repro
bazel build //packages/typescript/test/ts_project/a:tsconfig
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)Anything else relevant?
The text was updated successfully, but these errors were encountered: