API for running SWC under Bazel
Simplest usage:
load("@aspect_rules_swc//swc:swc.bzl", "swc")
swc(name = "transpile")
Rules
swc_transpiler
Underlying rule for the swc
macro.
Most users should just use swc instead.
Use this if you need more control over how the rule is called,
for example to set your own output labels for js_outs
.
Example usage (generated)
load("@rules_swc//swc:swc.bzl", "swc_transpiler")
swc_transpiler(
# A unique name for this target.
name = "",
# source files, typically .ts files in the source tree
srcs = [],
)
name
A unique name for this target.
args
additional arguments to pass to swc cli, see https://swc.rs/docs/usage/cli
data
runtime dependencies propagated to binaries that depend on this
js_outs
list of expected JavaScript output files.
There must be one for each entry in srcs, and in the same order.
map_outs
list of expected source map output files.
Can be empty, meaning no source maps should be produced. If non-empty, there must be one for each entry in srcs, and in the same order.
output_dir
whether to produce a directory output rather than individual files
source_maps
srcs
source files, typically .ts files in the source tree
swc_cli
binary that executes the swc CLI
swcrc
label of a configuration file for swc, see https://swc.rs/docs/configuration/swcrc
Macros and Functions
swc
Execute the swc compiler
Example usage (generated)
load("@rules_swc//swc:swc.bzl", "swc")
swc(
# A name for the target
name = "",
)
name
A name for the target
srcs
source files, typically .ts files in the source tree
args
additional arguments to pass to swc cli, see https://swc.rs/docs/usage/cli
data
runtime dependencies to be propagated in the runfiles
output_dir
whether to produce a directory output rather than individual files
swcrc
label of a configuration file for swc, see https://swc.rs/docs/configuration/swcrc
source_maps
If set, the --source-maps argument is passed to the swc cli with the value. See https://swc.rs/docs/usage/cli#--source-maps--s True/False are automaticaly converted to "true"/"false" string values the cli expects.
kwargs
additional named parameters like tags or visibility