When resolving references, the Ivy compiler has a few strategies it could use. For relative path, one of strategies is [`RelativePathStrategy`]( https://github.com/angular/angular/blob/master/packages/compiler-cli/src/ ngtsc/imports/README.md#relativepathstrategy). This strategy relies on `compilerOptions.rootDir` and `compilerOptions.rootDirs` to perform the resolution, but language service only passes `rootDirs` to the compiler, and not `rootDir`. In reality, `rootDir` is very different from `rootDirs` even though they sound the same. According to the official [TS documentation][1], > `rootDir` specifies the root directory of input files. Only use to control > the output directory structure with --outDir. > `rootDirs` is a list of root folders whose combined content represent the > structure of the project at runtime. See [Module Resolution documentation]( > https://www.typescriptlang.org/docs/handbook/ > module-resolution.html#virtual-directories-with-rootdirs) > for more details. For now, we keep the behavior between compiler and language service consistent, but we will revisit the notion of `rootDir` and how it is used later. Fix angular/vscode-ng-language-service#1039 [1]: https://www.typescriptlang.org/docs/handbook/compiler-options.html PR Close #40243
26 lines
921 B
Python
26 lines
921 B
Python
load("//tools:defaults.bzl", "ts_library")
|
|
|
|
package(default_visibility = ["//packages/language-service:__subpackages__"])
|
|
|
|
ts_library(
|
|
name = "ivy",
|
|
srcs = glob(["*.ts"]),
|
|
deps = [
|
|
"//packages/compiler",
|
|
"//packages/compiler-cli",
|
|
"//packages/compiler-cli/src/ngtsc/core",
|
|
"//packages/compiler-cli/src/ngtsc/core:api",
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
"//packages/compiler-cli/src/ngtsc/imports",
|
|
"//packages/compiler-cli/src/ngtsc/incremental",
|
|
"//packages/compiler-cli/src/ngtsc/metadata",
|
|
"//packages/compiler-cli/src/ngtsc/reflection",
|
|
"//packages/compiler-cli/src/ngtsc/shims",
|
|
"//packages/compiler-cli/src/ngtsc/typecheck",
|
|
"//packages/compiler-cli/src/ngtsc/typecheck/api",
|
|
"//packages/compiler-cli/src/ngtsc/util",
|
|
"@npm//@types/node",
|
|
"@npm//typescript",
|
|
],
|
|
)
|