-
-
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: allow user to choose any output path for outputs, such as custom…
… extension or subdirectory
- Loading branch information
Showing
7 changed files
with
58 additions
and
7 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
docs/*.md | ||
**/expected.js | ||
**/expected.cjs |
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
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,30 @@ | ||
load("@aspect_rules_swc//swc:swc.bzl", swc = "swc_rule") | ||
load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | ||
|
||
[ | ||
swc( | ||
name = "transpile_" + format, | ||
srcs = ["in.ts"], | ||
args = [ | ||
"-C", | ||
"module.type=" + format, | ||
], | ||
js_outs = [format + "/out." + ("cjs" if format == "commonjs" else "js")], | ||
) | ||
for format in [ | ||
"commonjs", | ||
"es6", | ||
] | ||
] | ||
|
||
diff_test( | ||
name = "test_commonjs", | ||
file1 = "commonjs/out.cjs", | ||
file2 = "expected.cjs", | ||
) | ||
|
||
diff_test( | ||
name = "test_es6", | ||
file1 = "es6/out.js", | ||
file2 = "expected.js", | ||
) |
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,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.a = void 0; | ||
var a = "a"; | ||
exports.a = a; | ||
|
||
|
||
//# sourceMappingURL=out.cjs.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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: string = "a"; |
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