Only emit a performance trace if the rule has sources, and thus has a generating
action. This fixes a bug where base ts_library aliases fail to compile with
perf_trace set to true.

PiperOrigin-RevId: 177300740
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index 7ebcb29..55e851c 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -226,7 +226,7 @@
   tsconfig_es6["compilerOptions"]["declaration"] = False
   tsconfig_es6["compilerOptions"].pop("declarationDir")
   outputs = transpiled_closure_js + tsickle_externs
-  if perf_trace:
+  if perf_trace and has_sources:
     perf_trace_file = ctx.new_file(ctx.label.name + ".es6.trace")
     tsconfig_es6["bazelOptions"]["perfTracePath"] = perf_trace_file.path
     outputs.append(perf_trace_file)