File tree Expand file tree Collapse file tree 4 files changed +22
-21
lines changed Expand file tree Collapse file tree 4 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 1- load ("@aspect_rules_swc//swc:defs.bzl" , "swc" )
2- load ("@aspect_rules_ts//ts:defs.bzl" , "ts_project" )
31load ("@aspect_rules_js//js:defs.bzl" , "js_binary" )
4- load ("@bazel_skylib//lib:partial.bzl" , "partial" )
52load ("@npm//:defs.bzl" , "npm_link_all_packages" )
3+ load ("//:defs.bzl" , "ts_project" )
64
75npm_link_all_packages (name = "node_modules" )
86
97ts_project (
108 name = "pkg" ,
119 srcs = ["src/main.ts" ],
1210 declaration = True ,
13- transpiler = partial .make (
14- swc ,
15- swcrc = "//:.swcrc" ,
16- ),
1711 tsconfig = "//:tsconfig" ,
1812 deps = [
1913 ":node_modules/inspirational-quotes" , # this uses the version defined in the local package.json
Original file line number Diff line number Diff line change 1+ """
2+ @aspect_rules_ts macros to enable custom config, transpiler.
3+ """
4+
5+ load ("@aspect_rules_ts//ts:defs.bzl" , _ts_project = "ts_project" )
6+ load ("@aspect_rules_swc//swc:defs.bzl" , "swc" )
7+ load ("@bazel_skylib//lib:partial.bzl" , "partial" )
8+
9+ def ts_project (name , ** kwargs ):
10+ _ts_project (
11+ name = name ,
12+ declaration = kwargs .pop ("declaration" , True ),
13+ transpiler = partial .make (
14+ swc ,
15+ swcrc = "//:.swcrc" ,
16+ ),
17+ tsconfig = kwargs .pop ("tsconfig" , "//:tsconfig" ),
18+ ** kwargs
19+ )
Original file line number Diff line number Diff line change 1- load ("@aspect_rules_swc//swc:defs.bzl" , "swc" )
2- load ("@aspect_rules_ts//ts:defs.bzl" , "ts_project" )
31load ("@aspect_rules_js//npm:defs.bzl" , "npm_package" )
4- load ("@bazel_skylib//lib:partial .bzl" , "partial " )
2+ load ("//:defs .bzl" , "ts_project " )
53
64ts_project (
75 name = "one_lib" ,
86 srcs = ["src/main.ts" ],
97 declaration = True ,
10- transpiler = partial .make (
11- swc ,
12- swcrc = "//:.swcrc" ,
13- ),
148 tsconfig = "//:tsconfig" ,
159 deps = [
1610 "//:node_modules/@types/node" ,
Original file line number Diff line number Diff line change 1- load ("@aspect_rules_swc//swc:defs.bzl" , "swc" )
2- load ("@aspect_rules_ts//ts:defs.bzl" , "ts_project" )
31load ("@aspect_rules_js//npm:defs.bzl" , "npm_package" )
4- load ("@bazel_skylib//lib:partial .bzl" , "partial " )
2+ load ("//:defs .bzl" , "ts_project " )
53
64ts_project (
75 name = "shared_lib" ,
86 srcs = ["src/main.ts" ],
97 declaration = True ,
10- transpiler = partial .make (
11- swc ,
12- swcrc = "//:.swcrc" ,
13- ),
148 tsconfig = "//:tsconfig" ,
159 deps = [
1610 "//:node_modules/@types/node" ,
You can’t perform that action at this time.
0 commit comments