From 7058072ff645a64e7944d16fcf381f87200794b1 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Wed, 8 Aug 2018 18:44:59 +0100 Subject: [PATCH] feat(ivy): enable .ngfactory.js generation in g3 only (#25392) This turns on generation of ngfactory.js files when compiling in Ivy mode in g3. They're not turned on for Bazel users as there appears to be a strange interaction with the way our tests run in Bazel mode. PR Close #25392 --- packages/bazel/src/ng_module.bzl | 2 ++ packages/bazel/src/ngc-wrapped/index.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/bazel/src/ng_module.bzl b/packages/bazel/src/ng_module.bzl index 5816d44025..a155413283 100644 --- a/packages/bazel/src/ng_module.bzl +++ b/packages/bazel/src/ng_module.bzl @@ -175,6 +175,8 @@ def _expected_outs(ctx): metadata = [".metadata.json"] else: devmode_js = [".js"] + if not _is_bazel(): + devmode_js += ".ngfactory.js" summaries = [] metadata = [] elif include_ng_files and short_path.endswith(".css"): diff --git a/packages/bazel/src/ngc-wrapped/index.ts b/packages/bazel/src/ngc-wrapped/index.ts index 22f813b434..4e1e92730d 100644 --- a/packages/bazel/src/ngc-wrapped/index.ts +++ b/packages/bazel/src/ngc-wrapped/index.ts @@ -127,7 +127,11 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true, // Disable downleveling and Closure annotation if in Ivy mode. if (isInIvyMode) { - compilerOpts.annotateForClosureCompiler = false; + // In pass-through mode for TypeScript, we want to turn off decorator transpilation entirely. + // This causes ngc to be have exactly like tsc. + if (compilerOpts.enableIvy === 'tsc') { + compilerOpts.annotateForClosureCompiler = false; + } compilerOpts.annotationsAs = 'decorators'; }