@ngtools/webpack 9.0.3 → 9.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngtools/webpack",
3
- "version": "9.0.3",
3
+ "version": "9.0.7",
4
4
  "description": "Webpack plugin that AoT compiles your Angular components and modules.",
5
5
  "main": "./src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/core": "9.0.3",
28
+ "@angular-devkit/core": "9.0.7",
29
29
  "enhanced-resolve": "4.1.1",
30
30
  "rxjs": "6.5.3",
31
31
  "webpack-sources": "1.4.3"
@@ -328,7 +328,7 @@ class AngularCompilerPlugin {
328
328
  benchmark_1.time('AngularCompilerPlugin._listLazyRoutesFromProgram.createProgram');
329
329
  ngProgram = compiler_cli_1.createProgram({
330
330
  rootNames: this._rootNames,
331
- options: { ...this._compilerOptions, genDir: '', collectAllErrors: true },
331
+ options: { ...this._compilerOptions, genDir: '', collectAllErrors: true, enableIvy: false },
332
332
  host: this._compilerHost,
333
333
  });
334
334
  benchmark_1.timeEnd('AngularCompilerPlugin._listLazyRoutesFromProgram.createProgram');
@@ -134,6 +134,11 @@ function typeReferenceToExpression(entityNameToExpression, node, typeChecker) {
134
134
  case ts.SyntaxKind.NumberKeyword:
135
135
  case ts.SyntaxKind.NumericLiteral:
136
136
  return ts.createIdentifier('Number');
137
+ case ts.SyntaxKind.UnionType:
138
+ const childTypeNodes = node.types.filter(t => t.kind !== ts.SyntaxKind.NullKeyword);
139
+ return childTypeNodes.length === 1
140
+ ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0], typeChecker)
141
+ : undefined;
137
142
  case ts.SyntaxKind.TypeReference:
138
143
  const typeRef = node;
139
144
  let typeSymbol = typeChecker.getSymbolAtLocation(typeRef.typeName);
@@ -65,11 +65,7 @@ function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions)
65
65
  break;
66
66
  }
67
67
  if (isTypeReferenceForDecoratoredNode) {
68
- symbol = typeChecker.getSymbolAtLocation(node);
69
- }
70
- else {
71
- // If type reference is not for Decorator skip and marked as unused.
72
- return;
68
+ symbol = typeChecker.getSymbolAtLocation(node.typeName);
73
69
  }
74
70
  }
75
71
  else {