Skip to content

Commit

Permalink
fix(#9216): fix style HMR in certain cases
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Nov 28, 2023
1 parent 1e8d28d commit c9b17e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/vite-plugin-astro/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c9b17e9

Please sign in to comment.