@ngtools/webpack 18.1.1 → 18.2.0-next.1

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": "18.1.1",
3
+ "version": "18.2.0-next.1",
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
  "peerDependencies": {
28
- "@angular/compiler-cli": "^18.0.0",
28
+ "@angular/compiler-cli": "^18.0.0 || ^18.2.0-next.0",
29
29
  "typescript": ">=5.4 <5.6",
30
30
  "webpack": "^5.54.0"
31
31
  },
@@ -72,9 +72,8 @@ function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions)
72
72
  let symbol;
73
73
  switch (node.kind) {
74
74
  case ts.SyntaxKind.Identifier:
75
- const parent = node.parent;
76
- if (parent && ts.isShorthandPropertyAssignment(parent)) {
77
- const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(parent);
75
+ if (node.parent && ts.isShorthandPropertyAssignment(node.parent)) {
76
+ const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(node.parent);
78
77
  if (shorthandSymbol) {
79
78
  symbol = shorthandSymbol;
80
79
  }
@@ -105,7 +105,7 @@ function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceIm
105
105
  switch (name) {
106
106
  case 'moduleId':
107
107
  return undefined;
108
- case 'templateUrl':
108
+ case 'templateUrl': {
109
109
  const url = getResourceUrl(node.initializer);
110
110
  if (!url) {
111
111
  return node;
@@ -115,9 +115,10 @@ function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceIm
115
115
  return node;
116
116
  }
117
117
  return nodeFactory.updatePropertyAssignment(node, nodeFactory.createIdentifier('template'), importName);
118
+ }
118
119
  case 'styles':
119
120
  case 'styleUrl':
120
- case 'styleUrls':
121
+ case 'styleUrls': {
121
122
  const isInlineStyle = name === 'styles';
122
123
  let styles;
123
124
  if (ts.isStringLiteralLike(node.initializer)) {
@@ -139,6 +140,7 @@ function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceIm
139
140
  styleReplacements.push(...styles);
140
141
  }
141
142
  return undefined;
143
+ }
142
144
  default:
143
145
  return node;
144
146
  }