Skip to content

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

Merged
merged 1 commit into from
Mar 24, 2017

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Mar 17, 2017

So they are rebuilt and type checked when the resource changes.

@hansl hansl force-pushed the resources-deps branch 3 times, most recently from 1b4e44a to bfcdc68 Compare March 19, 2017 15:44
Copy link
Contributor

@filipesilva filipesilva left a 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",
Copy link
Contributor

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.

Copy link
Contributor Author

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.
@filipesilva
Copy link
Contributor

LGTM

const arr = <ts.ArrayLiteralExpression[]>(
refactor.findAstNodes(node, ts.SyntaxKind.ArrayLiteralExpression, false));
if (!arr || arr.length == 0 || arr[0].elements.length == 0) {
return;
Copy link

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.

Copy link
Contributor

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?

@hansl hansl deleted the resources-deps branch August 2, 2018 19:59
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants