-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@angular/build): enable component stylesheet hot replacement by default #28646
Conversation
7cf65cf
to
b5eb852
Compare
b5eb852
to
656f5b8
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.
LGTM, just some minor readability suggestions. Up to you if they're worth changing.
// TODO: Enable by default once full support across CLI and FW is integrated | ||
browserOptions.externalRuntimeStyles = useComponentStyleHmr; | ||
// Enable to support component style hot reloading (`NG_HMR_CSTYLES=0` can be used to disable) | ||
browserOptions.externalRuntimeStyles = !!serverOptions.liveReload && useComponentStyleHmr; |
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.
Consider: Prefer Boolean(...)
over !!
to be more clear about your intent.
656f5b8
to
3ea7e12
Compare
…default When using the `application` builder (default for new projects) with the development server, component style only changes will now automatically replace the styles within the running application without a full reload of the page. No application code changes are necessary and both file-based (`styleUrl`/`styleUrls`) and inline (`styles`) component styles are supported. Within a component template, `<style>` elements and `<link rel="stylesheet">` elements with relative `href` attributes are also supported. If any issues are encountered or it is preferred to not hot replace component styles, the `NG_HMR_CSTYLES=0` environment variable can be used to disable the feature. Setting the `liveReload` option to false will also disable all updates.
3ea7e12
to
09e915f
Compare
When using the
application
builder (default for new projects) with the development server, component style only changes will now automatically replace the styles within the running application without a full reload of the page. No application code changes are necessary and both file-based (styleUrl
/styleUrls
) and inline (styles
) component styles are supported. Within a component template,<style>
elements and<link rel="stylesheet">
elements with relativehref
attributes are also supported.If any issues are encountered or it is preferred to not hot replace component styles, the
NG_HMR_CSTYLES=0
environment variable can be used to disable the feature. Setting theliveReload
option to false will also disable all updates.