Skip to content

Commit 7058072

Browse files
alxhubbenlesh
authored andcommitted
feat(ivy): enable .ngfactory.js generation in g3 only (angular#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 angular#25392
1 parent 33fd7e0 commit 7058072

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/bazel/src/ng_module.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ def _expected_outs(ctx):
175175
metadata = [".metadata.json"]
176176
else:
177177
devmode_js = [".js"]
178+
if not _is_bazel():
179+
devmode_js += ".ngfactory.js"
178180
summaries = []
179181
metadata = []
180182
elif include_ng_files and short_path.endswith(".css"):

packages/bazel/src/ngc-wrapped/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
127127

128128
// Disable downleveling and Closure annotation if in Ivy mode.
129129
if (isInIvyMode) {
130-
compilerOpts.annotateForClosureCompiler = false;
130+
// In pass-through mode for TypeScript, we want to turn off decorator transpilation entirely.
131+
// This causes ngc to be have exactly like tsc.
132+
if (compilerOpts.enableIvy === 'tsc') {
133+
compilerOpts.annotateForClosureCompiler = false;
134+
}
131135
compilerOpts.annotationsAs = 'decorators';
132136
}
133137

0 commit comments

Comments
 (0)