forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.bzl
38 lines (33 loc) · 1.02 KB
/
defaults.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Re-export of some bazel rules with repository-wide defaults."""
load("@npm//@bazel/typescript:index.bzl", _ts_library = "ts_library")
_DEFAULT_TSCONFIG_TEST = "//:tsconfig-test.json"
def ts_library(
name,
tsconfig = None,
testonly = False,
deps = [],
devmode_module = None,
devmode_target = None,
**kwargs):
"""Default values for ts_library"""
if testonly:
# Match the types[] in //packages:tsconfig-test.json
deps.append("@npm//@types/jasmine")
deps.append("@npm//@types/node")
if not tsconfig and testonly:
tsconfig = _DEFAULT_TSCONFIG_TEST
if not devmode_module:
devmode_module = "commonjs"
if not devmode_target:
devmode_target = "es2018"
_ts_library(
name = name,
testonly = testonly,
deps = deps,
# @external_begin
tsconfig = tsconfig,
devmode_module = devmode_module,
devmode_target = devmode_target,
# @external_end
**kwargs
)