Skip to content

Commit 898b436

Browse files
Alanmgechev
Alan
authored andcommitted
fix(@ngtools/webpack): replace resources should return class node when modified
This is also the root cause of spec large fail occasionally as we keep checking the child class nodes
1 parent e2d480c commit 898b436

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/ngtools/webpack/src/transformers/replace_resources.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@ export function replaceResources(
1717

1818
const visitNode: ts.Visitor = (node: ts.Decorator) => {
1919
if (ts.isClassDeclaration(node)) {
20-
node.decorators = ts.visitNodes(
20+
const decorators = ts.visitNodes(
2121
node.decorators,
2222
(node: ts.Decorator) => visitDecorator(node, typeChecker),
2323
);
24+
25+
// todo: we need to investigate and confirm that using
26+
// `updateClassDeclaration` has no regressions
27+
return ts.updateClassDeclaration(
28+
node,
29+
decorators,
30+
node.modifiers,
31+
node.name,
32+
node.typeParameters,
33+
node.heritageClauses,
34+
node.members,
35+
);
2436
}
2537

2638
return ts.visitEachChild(node, visitNode, context);

0 commit comments

Comments
 (0)