@ngtools/webpack 15.1.0-next.0 → 15.1.0-next.2
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
|
@@ -94,7 +94,7 @@ function replaceBootstrap(getTypeChecker) {
|
|
|
94
94
|
if (target.text === PLATFORM_BROWSER_DYNAMIC_NAME) {
|
|
95
95
|
if (!bootstrapNamespace) {
|
|
96
96
|
bootstrapNamespace = nodeFactory.createUniqueName('__NgCli_bootstrap_');
|
|
97
|
-
bootstrapImport = nodeFactory.createImportDeclaration(undefined,
|
|
97
|
+
bootstrapImport = nodeFactory.createImportDeclaration(undefined, nodeFactory.createImportClause(false, undefined, nodeFactory.createNamespaceImport(bootstrapNamespace)), nodeFactory.createStringLiteral('@angular/platform-browser'));
|
|
98
98
|
}
|
|
99
99
|
replacedNodes.push(target);
|
|
100
100
|
return nodeFactory.updateCallExpression(node, nodeFactory.createPropertyAccessExpression(bootstrapNamespace, 'platformBrowser'), node.typeArguments, node.arguments);
|
|
@@ -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
|
});
|
|
@@ -214,7 +214,7 @@ function createResourceImport(nodeFactory, url, resourceImportDeclarations, modu
|
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
216
|
const importName = nodeFactory.createIdentifier(`__NG_CLI_RESOURCE__${resourceImportDeclarations.length}`);
|
|
217
|
-
resourceImportDeclarations.push(nodeFactory.createImportDeclaration(undefined,
|
|
217
|
+
resourceImportDeclarations.push(nodeFactory.createImportDeclaration(undefined, nodeFactory.createImportClause(false, importName, undefined), urlLiteral));
|
|
218
218
|
return importName;
|
|
219
219
|
}
|
|
220
220
|
}
|