File tree Expand file tree Collapse file tree 2 files changed +3
-28
lines changed
packages/ngtools/webpack/src Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -734,24 +734,7 @@ export class AngularWebpackPlugin {
734
734
// this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
735
735
// Once TypeScript provides support for keeping the dynamic import this workaround can
736
736
// be dropped.
737
- const compilerCliModule = await new Function ( `return import('@angular/compiler-cli');` ) ( ) ;
738
- let compilerNgccModule ;
739
- try {
740
- compilerNgccModule = await new Function ( `return import('@angular/compiler-cli/ngcc');` ) ( ) ;
741
- } catch {
742
- // If the `exports` field entry is not present then try the file directly.
743
- // TODO_ESM: This try/catch can be removed once the `exports` field is present in `@angular/compiler-cli`
744
- compilerNgccModule = await new Function (
745
- `return import('@angular/compiler-cli/ngcc/index.js');` ,
746
- ) ( ) ;
747
- }
748
- // If it is not ESM then the functions needed will be stored in the `default` property.
749
- // TODO_ESM: This conditional can be removed when `@angular/compiler-cli` is ESM only.
750
- this . compilerCliModule = compilerCliModule . readConfiguration
751
- ? compilerCliModule
752
- : compilerCliModule . default ;
753
- this . compilerNgccModule = compilerNgccModule . process
754
- ? compilerNgccModule
755
- : compilerNgccModule . default ;
737
+ this . compilerCliModule = await new Function ( `return import('@angular/compiler-cli');` ) ( ) ;
738
+ this . compilerNgccModule = await new Function ( `return import('@angular/compiler-cli/ngcc');` ) ( ) ;
756
739
}
757
740
}
Original file line number Diff line number Diff line change @@ -120,14 +120,6 @@ export class NgccProcessor {
120
120
const timeLabel = 'NgccProcessor.process' ;
121
121
time ( timeLabel ) ;
122
122
123
- // Temporary workaround during transition to ESM-only @angular/compiler-cli
124
- // TODO_ESM: This workaround should be removed prior to the final release of v13
125
- // and replaced with only `this.compilerNgcc.ngccMainFilePath`.
126
- const ngccExecutablePath =
127
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
- ( this . compilerNgcc as any ) . ngccMainFilePath ??
129
- require . resolve ( '@angular/compiler-cli/ngcc/main-ngcc.js' ) ;
130
-
131
123
// We spawn instead of using the API because:
132
124
// - NGCC Async uses clustering which is problematic when used via the API which means
133
125
// that we cannot setup multiple cluster masters with different options.
@@ -136,7 +128,7 @@ export class NgccProcessor {
136
128
const { status, error } = spawnSync (
137
129
process . execPath ,
138
130
[
139
- ngccExecutablePath ,
131
+ this . compilerNgcc . ngccMainFilePath ,
140
132
'--source' /** basePath */ ,
141
133
this . _nodeModulesDirectory ,
142
134
'--properties' /** propertiesToConsider */ ,
You can’t perform that action at this time.
0 commit comments