ts_library does not work --incremental option (TS 3.5.2)
🐞 bug report
Affected Rule
The issue is caused by the rule: ts_library
Is this a regression?
No
Description
Failing to compile ts files when using Typescript 3.5.2
🔬 Minimal Reproduction
Use this repo to reproduce: https://github.com/siberex/bazel-issue-rules_nodejs_typescript_latest_option_incremental
cd /tmp
git clone [email protected]:siberex/bazel-issue-rules_nodejs_typescript_latest_option_incremental.git
cd bazel-issue-rules_nodejs_typescript_latest_option_incremental
bazel run //:bin
🔥 Exception or Error
error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option `--tsBuildInfoFile` is specified.
🌍 Your Environment
Operating System:
darwin
Output of bazel version:
0.27.1
Rules version (SHA):
0.32.2 (6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4)
Anything else relevant?
−
I don't think the incremental is or will be supported by TS under bazel since bazel does it's own incrimental stuff
Yes, but I wonder why it works with typescript 3.4.5, but not with 3.5.2 (same config)
This is probably blocked on us upgrading google-internal to TS 3.5
@siberex Does it work when you remove the incremental flag?
Does it work when you remove the
incrementalflag?
yes, it works with TS 3.5.2 with incremental removed from tsconfig
Then I think that's the correct behaviour, since the TS compilers incremental would probably conflict with bazels own incremental compiling. But maybe it should be documented why it's like this.
Note, one possible "escape hatch" is to use plain tsc rather than ts_library, see https://github.com/bazelbuild/rules_nodejs/blob/master/packages/typescript/docs/install.md#alternatives
No longer in scope for rules_nodejs which only supplies the Node.js toolchain as of v6.0.0.
Downstream canonical JavaScript + Node.js ruleset is now https://github.com/aspect-build/rules_js.