@@ -232,7 +232,6 @@ export function compile({
232232 }
233233
234234 // Detect from compilerOpts whether the entrypoint is being invoked in Ivy mode.
235- const isInIvyMode = ! ! compilerOpts . enableIvy ;
236235 if ( ! compilerOpts . rootDirs ) {
237236 throw new Error ( 'rootDirs is not set!' ) ;
238237 }
@@ -259,16 +258,14 @@ export function compile({
259258 bazelHost = new CompilerHost ( files , compilerOpts , bazelOpts , tsHost , fileLoader ) ;
260259 }
261260
262- if ( isInIvyMode ) {
263- const delegate = bazelHost . shouldSkipTsickleProcessing . bind ( bazelHost ) ;
264- bazelHost . shouldSkipTsickleProcessing = ( fileName : string ) => {
265- // The base implementation of shouldSkipTsickleProcessing checks whether `fileName` is part of
266- // the original `srcs[]`. For Angular (Ivy) compilations, ngfactory/ngsummary files that are
267- // shims for original .ts files in the program should be treated identically. Thus, strip the
268- // '.ngfactory' or '.ngsummary' part of the filename away before calling the delegate.
269- return delegate ( fileName . replace ( / \. ( n g f a c t o r y | n g s u m m a r y ) \. t s $ / , '.ts' ) ) ;
270- } ;
271- }
261+ const delegate = bazelHost . shouldSkipTsickleProcessing . bind ( bazelHost ) ;
262+ bazelHost . shouldSkipTsickleProcessing = ( fileName : string ) => {
263+ // The base implementation of shouldSkipTsickleProcessing checks whether `fileName` is part of
264+ // the original `srcs[]`. For Angular (Ivy) compilations, ngfactory/ngsummary files that are
265+ // shims for original .ts files in the program should be treated identically. Thus, strip the
266+ // '.ngfactory' or '.ngsummary' part of the filename away before calling the delegate.
267+ return delegate ( fileName . replace ( / \. ( n g f a c t o r y | n g s u m m a r y ) \. t s $ / , '.ts' ) ) ;
268+ } ;
272269
273270 // By default, disable tsickle decorator transforming in the tsickle compiler host.
274271 // The Angular compilers have their own logic for decorator processing and we wouldn't
@@ -286,9 +283,7 @@ export function compile({
286283 // decorator transformation is still needed. This might be because of custom decorators
287284 // with the `@Annotation` JSDoc that will be processed by the tsickle decorator transform.
288285 // TODO: Figure out why this is needed in g3 and how we can improve this. FW-2225
289- if ( isInIvyMode ) {
290- bazelHost . transformDecorators = true ;
291- }
286+ bazelHost . transformDecorators = true ;
292287 } else {
293288 compilerOpts . annotateForClosureCompiler = false ;
294289 }
0 commit comments