diff --git a/src/cdk/coercion/BUILD.bazel b/src/cdk/coercion/BUILD.bazel index 23aa13dfe4c..3f01ece0796 100644 --- a/src/cdk/coercion/BUILD.bazel +++ b/src/cdk/coercion/BUILD.bazel @@ -6,7 +6,6 @@ ts_library( name = "coercion", srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), module_name = "@angular/cdk/coercion", - deps = ["@matdeps//tslib"], ) ts_library( diff --git a/src/cdk/keycodes/BUILD.bazel b/src/cdk/keycodes/BUILD.bazel index da35d5b73e2..d4523da2703 100644 --- a/src/cdk/keycodes/BUILD.bazel +++ b/src/cdk/keycodes/BUILD.bazel @@ -6,7 +6,6 @@ ts_library( name = "keycodes", srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), module_name = "@angular/cdk/keycodes", - deps = ["@matdeps//tslib"], ) ts_library( diff --git a/tools/defaults.bzl b/tools/defaults.bzl index f76cb976c2e..7d3a734ecfe 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -15,13 +15,17 @@ def _getDefaultTsConfig(testonly): else: return _DEFAULT_TSCONFIG_BUILD -def ts_library(tsconfig = None, testonly = False, **kwargs): +def ts_library(tsconfig = None, deps = [], testonly = False, **kwargs): + # Add tslib because we use import helpers for all public packages. + local_deps = ["@matdeps//tslib"] + deps + if not tsconfig: tsconfig = _getDefaultTsConfig(testonly) _ts_library( tsconfig = tsconfig, testonly = testonly, + deps = local_deps, node_modules = _DEFAULT_TS_TYPINGS, **kwargs ) @@ -31,8 +35,7 @@ def ng_module(deps = [], tsconfig = None, testonly = False, **kwargs): tsconfig = _getDefaultTsConfig(testonly) local_deps = [ - # Since we use the TypeScript import helpers (tslib) for each TypeScript configuration, - # we declare TSLib as default dependency + # Add tslib because we use import helpers for all public packages. "@matdeps//tslib", # Depend on the module typings for each `ng_module`. Since all components within the project