@ngtools/webpack 15.0.1 → 15.0.3
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
|
@@ -66,31 +66,33 @@ function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions)
|
|
|
66
66
|
}
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
symbol = typeChecker.getSymbolAtLocation(node);
|
|
69
|
+
// Type reference imports do not need to be emitted when emitDecoratorMetadata is disabled.
|
|
70
|
+
if (ts.isTypeReferenceNode(node) && !compilerOptions.emitDecoratorMetadata) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let symbol;
|
|
74
|
+
switch (node.kind) {
|
|
75
|
+
case ts.SyntaxKind.Identifier:
|
|
76
|
+
const parent = node.parent;
|
|
77
|
+
if (parent && ts.isShorthandPropertyAssignment(parent)) {
|
|
78
|
+
const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(parent);
|
|
79
|
+
if (shorthandSymbol) {
|
|
80
|
+
symbol = shorthandSymbol;
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
symbol = typeChecker.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
symbol = typeChecker.getSymbolAtLocation(node);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case ts.SyntaxKind.ExportSpecifier:
|
|
88
|
+
symbol = typeChecker.getExportSpecifierLocalTargetSymbol(node);
|
|
89
|
+
break;
|
|
90
|
+
case ts.SyntaxKind.ShorthandPropertyAssignment:
|
|
91
|
+
symbol = typeChecker.getShorthandAssignmentValueSymbol(node);
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (symbol) {
|
|
95
|
+
usedSymbols.add(symbol);
|
|
94
96
|
}
|
|
95
97
|
ts.forEachChild(node, visit);
|
|
96
98
|
});
|