Skip to content
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

fix(vite-plugin-angular): fix SSG and HMR of external component stylesheets #1548

Merged

Conversation

mattlewis92
Copy link
Contributor

PR Checklist

Closes #

What is the new behavior?

Fixes HMR of component styleUrls when using SSG. Without this patch, all component stylesheet urls will be added to the DOM twice, and only the first one will be reloaded dynamically so the changes won't appear on the page.

To test it locally, you can make a change in apps/analog-app/src/app/pages/shipping/shipping.scss and observe HMR working on http://localhost:3000/shipping

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

@@ -187,6 +188,33 @@ export function augmentHostWithResources(

return null;
};

resourceHost.resourceNameToFileName = function (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit ecc0612
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/677d4f39083844000871db92
😎 Deploy Preview https://deploy-preview-1548--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit aa85948
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/677d5119d69fb00008520483
😎 Deploy Preview https://deploy-preview-1548--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit aa85948
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/677d5119ae2ec500081bea99
😎 Deploy Preview https://deploy-preview-1548--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mattlewis92 mattlewis92 force-pushed the fix-ssg-with-external-styles branch from ecc0612 to 83b961f Compare January 7, 2025 15:59
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit aa85948
🔍 Latest deploy log https://app.netlify.com/sites/analog-ng-app/deploys/677d511999f81300099d8607
😎 Deploy Preview https://deploy-preview-1548--analog-ng-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brandonroberts brandonroberts merged commit e6de3d7 into analogjs:beta Jan 7, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants