Skip to content

Commit

Permalink
fix(typescript): fix ts_library to allow deps with module_name but no…
Browse files Browse the repository at this point in the history
… module_root attrs (#1738)
  • Loading branch information
gregmagolan authored Mar 26, 2020
1 parent a6e29c2 commit 0b5ad2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ install_bazel_dependencies()
git_repository(
name = "build_bazel_rules_typescript",
commit = "10a5a86885f95ab788fd841ade47b6a16e0c13d6",
patches = ["//:rules_typescript_pr_496.patch"],
patches = [
"//:rules_typescript_pr_494.patch",
"//:rules_typescript_pr_496.patch",
],
remote = "http://github.com/bazelbuild/rules_typescript.git",
shallow_since = "1582757372 -0800",
)
Expand Down
13 changes: 13 additions & 0 deletions rules_typescript_pr_494.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git internal/common/module_mappings.bzl internal/common/module_mappings.bzl
index b74e5b8..286c3b3 100644
--- internal/common/module_mappings.bzl
+++ internal/common/module_mappings.bzl
@@ -76,7 +76,7 @@ def get_module_mappings(label, attrs, srcs = [], workspace_name = None, mappings
workspace_name or label.workspace_root,
label.package,
] if p])
- if attrs.module_root and attrs.module_root != ".":
+ if hasattr(attrs, "module_root") and attrs.module_root and attrs.module_root != ".":
mr = "%s/%s" % (mr, attrs.module_root)
if attrs.module_root.endswith(".ts"):
if workspace_name:

0 comments on commit 0b5ad2a

Please sign in to comment.