File tree Expand file tree Collapse file tree 2 files changed +10
-22
lines changed
packages/ngtools/webpack/src Expand file tree Collapse file tree 2 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export class AngularCompilerPlugin {
151151 }
152152
153153 static isSupported ( ) {
154- return VERSION && parseInt ( VERSION . major ) >= 5 ;
154+ return VERSION && parseInt ( VERSION . major ) >= 8 ;
155155 }
156156
157157 private _setupOptions ( options : AngularCompilerPluginOptions ) {
@@ -659,24 +659,13 @@ export class AngularCompilerPlugin {
659659
660660 let ngccProcessor : NgccProcessor | undefined ;
661661 if ( this . _compilerOptions . enableIvy ) {
662- let ngcc : typeof import ( '@angular/compiler-cli/ngcc' ) | undefined ;
663- try {
664- // this is done for the sole reason that @ngtools /webpack
665- // support versions of Angular that don't have NGCC API
666- ngcc = require ( '@angular/compiler-cli/ngcc' ) ;
667- } catch {
668- }
669-
670- if ( ngcc ) {
671- ngccProcessor = new NgccProcessor (
672- ngcc ,
673- this . _mainFields ,
674- compilerWithFileSystems . inputFileSystem ,
675- this . _warnings ,
676- this . _errors ,
677- this . _basePath ,
678- ) ;
679- }
662+ ngccProcessor = new NgccProcessor (
663+ this . _mainFields ,
664+ compilerWithFileSystems . inputFileSystem ,
665+ this . _warnings ,
666+ this . _errors ,
667+ this . _basePath ,
668+ ) ;
680669 }
681670
682671 // Create the webpack compiler host.
Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { Logger } from '@angular/compiler-cli/ngcc' ;
9+ import { Logger , process as mainNgcc } from '@angular/compiler-cli/ngcc' ;
1010import { existsSync } from 'fs' ;
1111import * as path from 'path' ;
1212import * as ts from 'typescript' ;
@@ -29,7 +29,6 @@ export class NgccProcessor {
2929 private _nodeModulesDirectory : string ;
3030
3131 constructor (
32- private readonly ngcc : typeof import ( '@angular/compiler-cli/ngcc' ) ,
3332 private readonly propertiesToConsider : string [ ] ,
3433 private readonly inputFileSystem : InputFileSystem ,
3534 private readonly compilationWarnings : ( Error | string ) [ ] ,
@@ -63,7 +62,7 @@ export class NgccProcessor {
6362
6463 const timeLabel = `NgccProcessor.processModule.ngcc.process+${ moduleName } ` ;
6564 time ( timeLabel ) ;
66- this . ngcc . process ( {
65+ mainNgcc ( {
6766 basePath : this . _nodeModulesDirectory ,
6867 targetEntryPointPath : path . dirname ( packageJsonPath ) ,
6968 propertiesToConsider : this . propertiesToConsider ,
You can’t perform that action at this time.
0 commit comments