Expose compiled ES5 and ES6 sources in output_groups of ts_library.
PiperOrigin-RevId: 190768344
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index 6b793af..e0b47c4 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -351,6 +351,10 @@
return {
"files": files,
+ "output_groups": {
+ "es6_sources": es6_sources,
+ "es5_sources": es5_sources,
+ },
"runfiles": ctx.runfiles(
# Note: don't include files=... here, or they will *always* be built
# by any dependent rule, regardless of whether it needs them.
@@ -385,6 +389,6 @@
# converting it to an immutable struct.
def ts_providers_dict_to_struct(d):
for key, value in d.items():
- if type(value) == type({}):
+ if key != "output_groups" and type(value) == type({}):
d[key] = struct(**value)
return struct(**d)