-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ filegroup( | |
srcs = [ | ||
"a.ts", | ||
"b.ts", | ||
"sub/c.ts", | ||
], | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const c: string = "c"; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") | ||
load("@aspect_rules_swc//swc:defs.bzl", "swc") | ||
load("@aspect_bazel_lib//lib:testing.bzl", "assert_outputs") | ||
|
||
swc( | ||
name = "compile", | ||
srcs = [ | ||
"src/a.ts", | ||
"src/b.ts", | ||
"src/sub/c.ts", | ||
], | ||
out_dir = "out", | ||
root_dir = "src", | ||
source_maps = True, | ||
) | ||
|
||
# Since the srcs were in a filegroup, the swc macro cannot pre-declare the outputs. | ||
# So there is no label ":a.js" that we can reference from the build file. | ||
# However, a.js is still produced as one of the default outputs of the compile rule. | ||
# We can verify this in an action that depends on the ":compile" rule and reads the files. | ||
assert_outputs( | ||
name = "check_outputs", | ||
actual = "compile", | ||
expected = [ | ||
"examples/root_dir/out/a.js", | ||
"examples/root_dir/out/a.js.map", | ||
"examples/root_dir/out/b.js", | ||
"examples/root_dir/out/b.js.map", | ||
], | ||
) | ||
write_source_files( | ||
name = "test", | ||
files = { | ||
"expected/a.js": ":out/a.js", | ||
"expected/a.js.map": ":out/a.js.map", | ||
"expected/b.js": ":out/b.js", | ||
"expected/b.js.map": ":out/b.js.map", | ||
"expected/sub/c.js": ":out/sub/c.js", | ||
"expected/sub/c.js.map": ":out/sub/c.js.map", | ||
}, | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const c: string = "c"; |