Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/out_dir/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ ts_project(
},
)

ts_project(
name = "out_dir-params-dot",
srcs = ["main.ts"],
declaration = True,
declaration_map = True,
out_dir = ".",
tsconfig = {},
)

ts_project(
name = "out_dir-params",
srcs = ["main.ts"],
Expand All @@ -35,6 +44,12 @@ ts_project(
build_test(
name = "test",
targets = [
# outputs specified by the tsconfig attr
":out_dir-params-dot",
"main.js",
"main.d.ts",
"main.d.ts.map",

# outputs specified by the tsconfig attr
":out_dir-tsconfig",
"tsconfig/main.js",
Expand Down
34 changes: 34 additions & 0 deletions examples/root_dir/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,40 @@ assert_outputs(
],
)

# . should be a noop
ts_project(
name = "dot",
out_dir = "dot",
root_dir = ".",
tsconfig = "tsconfig-dot.json",
)

assert_outputs(
name = "dot_test",
actual = "dot",
expected = [
"examples/root_dir/dot/subdir/a.js",
"examples/root_dir/dot/subdir/deep/subdir/b.js",
],
)

# ./ should be a noop
ts_project(
name = "dot-slash",
out_dir = "dot-slash",
root_dir = ".",
tsconfig = "tsconfig-dotslash.json",
)

assert_outputs(
name = "dot-slash_test",
actual = "dot-slash",
expected = [
"examples/root_dir/dot-slash/subdir/a.js",
"examples/root_dir/dot-slash/subdir/deep/subdir/b.js",
],
)

# You can use the root_dir setting to strip a prefix
ts_project(
name = "strip",
Expand Down
5 changes: 5 additions & 0 deletions examples/root_dir/tsconfig-dot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"rootDir": "."
}
}
5 changes: 5 additions & 0 deletions examples/root_dir/tsconfig-dotslash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"rootDir": "./"
}
}