-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support .js inputs without out_dir
- Loading branch information
Showing
4 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Simple use case for swc: transpiling .js using the `swc` rule, similar to tsc with 'allowJs' | ||
""" | ||
|
||
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") | ||
load("@aspect_rules_swc//swc:defs.bzl", "swc") | ||
|
||
# Runs `swc in.js > ../../bazel-bin/examples/js_outs/in.js` | ||
swc( | ||
name = "compile", | ||
srcs = ["in.js"], | ||
) | ||
|
||
# Assert that the output of "compile" rule matches the expected file. | ||
write_source_files( | ||
name = "test", | ||
# There is no pre-declared output of the "compile" rule because the input is .js | ||
# so the the target name is used instead of output file. | ||
files = {"expected.js": ":compile"}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export var a = "simple"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const a = "simple"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters