-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
42 lines (36 loc) · 969 Bytes
/
BUILD.bazel
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
42
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_rules_swc//swc:defs.bzl", "swc")
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@bazel_skylib//lib:partial.bzl", "partial")
package(default_visibility = ["//visibility:public"])
ts_config(
name = "tsconfig",
src = ":tsconfig.json",
)
copy_to_bin(
name = "swcrc",
srcs = [".swcrc"],
)
npm_link_all_packages(name = "node_modules")
ts_project(
name = "app",
srcs = ["main.ts"],
declaration = True,
transpiler = partial.make(
swc,
swcrc = "//:swcrc",
),
tsconfig = "//:tsconfig",
deps = [
"//:node_modules/@types/node",
"//:node_modules/@types/sanitize-html",
"//:node_modules/sanitize-html",
],
)
js_binary(
name = "bin",
data = [":app"],
entry_point = "main.js",
)