Skip to content

Commit

Permalink
fix(@ngtools/webpack): replace resources should return class node whe…
Browse files Browse the repository at this point in the history
…n modified

This is also the root cause of spec large fail occasionally as we keep checking the child class nodes
  • Loading branch information
Alan authored and mgechev committed Mar 29, 2019
1 parent 54d2be9 commit 871eb69
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/ngtools/webpack/src/transformers/replace_resources.ts
Expand Up @@ -18,10 +18,22 @@ export function replaceResources(

const visitNode: ts.Visitor = (node: ts.Decorator) => {
if (ts.isClassDeclaration(node)) {
node.decorators = ts.visitNodes(
const decorators = ts.visitNodes(
node.decorators,
(node: ts.Decorator) => visitDecorator(node, typeChecker, directTemplateLoading),
);

// todo: we need to investigate and confirm that using
// `updateClassDeclaration` has no regressions
return ts.updateClassDeclaration(
node,
decorators,
node.modifiers,
node.name,
node.typeParameters,
node.heritageClauses,
node.members,
);
}

return ts.visitEachChild(node, visitNode, context);
Expand Down

0 comments on commit 871eb69

Please sign in to comment.