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 {
151
151
}
152
152
153
153
static isSupported ( ) {
154
- return VERSION && parseInt ( VERSION . major ) >= 5 ;
154
+ return VERSION && parseInt ( VERSION . major ) >= 8 ;
155
155
}
156
156
157
157
private _setupOptions ( options : AngularCompilerPluginOptions ) {
@@ -659,24 +659,13 @@ export class AngularCompilerPlugin {
659
659
660
660
let ngccProcessor : NgccProcessor | undefined ;
661
661
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
+ ) ;
680
669
}
681
670
682
671
// Create the webpack compiler host.
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { Logger } from '@angular/compiler-cli/ngcc' ;
9
+ import { Logger , process as mainNgcc } from '@angular/compiler-cli/ngcc' ;
10
10
import { existsSync } from 'fs' ;
11
11
import * as path from 'path' ;
12
12
import * as ts from 'typescript' ;
@@ -29,7 +29,6 @@ export class NgccProcessor {
29
29
private _nodeModulesDirectory : string ;
30
30
31
31
constructor (
32
- private readonly ngcc : typeof import ( '@angular/compiler-cli/ngcc' ) ,
33
32
private readonly propertiesToConsider : string [ ] ,
34
33
private readonly inputFileSystem : InputFileSystem ,
35
34
private readonly compilationWarnings : ( Error | string ) [ ] ,
@@ -63,7 +62,7 @@ export class NgccProcessor {
63
62
64
63
const timeLabel = `NgccProcessor.processModule.ngcc.process+${ moduleName } ` ;
65
64
time ( timeLabel ) ;
66
- this . ngcc . process ( {
65
+ mainNgcc ( {
67
66
basePath : this . _nodeModulesDirectory ,
68
67
targetEntryPointPath : path . dirname ( packageJsonPath ) ,
69
68
propertiesToConsider : this . propertiesToConsider ,
You can’t perform that action at this time.
0 commit comments