mirror of
https://github.com/withastro/astro.git
synced 2025-03-03 22:57:08 -05:00
parent
1e8d28de7f
commit
067a65f5b4
2 changed files with 7 additions and 2 deletions
5
.changeset/wicked-books-appear.md
Normal file
5
.changeset/wicked-books-appear.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix edge case where `<style>` updates inside of `.astro` files would ocassionally fail to update without reloading the page.
|
|
@ -97,8 +97,8 @@ export async function handleHotUpdate(
|
|||
// If only styles are changed, remove the component file from the update list
|
||||
if (isStyleOnlyChange) {
|
||||
logger.info('astro', msg.hmr({ file, style: true }));
|
||||
// remove base file and hoisted scripts
|
||||
return mods.filter((mod) => mod.id !== ctx.file && !mod.id?.endsWith('.ts'));
|
||||
// Only return the Astro styles that have changed!
|
||||
return mods.filter((mod) => mod.id?.includes('astro&type=style'));
|
||||
}
|
||||
|
||||
// Add hoisted scripts so these get invalidated
|
||||
|
|
Loading…
Add table
Reference in a new issue