forked from slamdev/bazel-js-showcase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
41 lines (37 loc) · 716 Bytes
/
BUILD
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
39
40
41
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "nodejs_binary")
load("@npm//typescript:index.bzl", "tsc")
genrule(
name = "gen",
outs = ["index.ts"],
cmd = """
cat >$@ <<EOL
import some from "lib_a";
some();
""",
)
tsc(
name = "tsc",
outs = ["index.js"],
args = [
"-p",
"$(execpath //:tsconfig.json)",
"--outDir",
"$(RULEDIR)",
],
data = [
":gen",
"//:tsconfig.json",
"//lib_a:lib",
"@npm//@types/node",
],
)
js_library(
name = "lib",
srcs = [":tsc"],
)
nodejs_binary(
name = "bin",
data = [":lib"],
entry_point = ":index.js",
visibility = ["//visibility:public"],
)