-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@ngtools/webpack): add template/styles as dependencies #5492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1b4e44a
to
bfcdc68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit. Also, does this fix an existing issue?
package.json
Outdated
@@ -131,6 +131,7 @@ | |||
"conventional-changelog": "^1.1.0", | |||
"dtsgenerator": "^0.9.1", | |||
"eslint": "^3.11.0", | |||
"eslint-plugin-standard": "^2.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you meant to have this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's that doing there. Done
So they are rebuilt when the resource changes. This PR refactor _replaceResources into _getResourceNodes which returns the AST nodes for templateUrl or styleUrls, then use that to get the URLs (values). For values that are not computable, we simply ignores.
LGTM |
const arr = <ts.ArrayLiteralExpression[]>( | ||
refactor.findAstNodes(node, ts.SyntaxKind.ArrayLiteralExpression, false)); | ||
if (!arr || arr.length == 0 || arr[0].elements.length == 0) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to return [];
? If you have a styleUrls: []
in your Component definition, this will cause ng
to fail compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tr11 that sounds like something that should be fixed. Would you be willing to make a PR with your fix and a test?
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
So they are rebuilt and type checked when the resource changes.