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
This commit is contained in:
Alex Rickabaugh 2018-08-08 18:44:59 +01:00 committed by Ben Lesh
parent 33fd7e0784
commit 7058072ff6
2 changed files with 7 additions and 1 deletions

View File

@ -175,6 +175,8 @@ def _expected_outs(ctx):
metadata = [".metadata.json"] metadata = [".metadata.json"]
else: else:
devmode_js = [".js"] devmode_js = [".js"]
if not _is_bazel():
devmode_js += ".ngfactory.js"
summaries = [] summaries = []
metadata = [] metadata = []
elif include_ng_files and short_path.endswith(".css"): elif include_ng_files and short_path.endswith(".css"):

View File

@ -127,7 +127,11 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
// Disable downleveling and Closure annotation if in Ivy mode. // Disable downleveling and Closure annotation if in Ivy mode.
if (isInIvyMode) { if (isInIvyMode) {
// 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.annotateForClosureCompiler = false;
}
compilerOpts.annotationsAs = 'decorators'; compilerOpts.annotationsAs = 'decorators';
} }