-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
- P3: minor bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)feat: hmrRelated to HMR (scope)Related to HMR (scope)feat: stylingRelated to styles (scope)Related to styles (scope)
Description
Astro Info
Astro v5.14.3
Vite v6.3.6
Node v22.14.0
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/node (v9.4.4)
If this issue only occurs in one browser, which browser is a problem?
Chrome
Describe the Bug
When modifying .scss files during development, Astro triggers a full page reload instead of hot module replacement (HMR). This disrupts the development workflow as it loses current state and scroll position.
If I write:
if (import.meta.hot) {
import.meta.hot.on('vite:beforeFullReload', (payload) => {
console.log(payload);
})
}After save a .scss file, this log appears:
{type: 'full-reload'}What's the expected result?
Changes to .scss files should trigger CSS-only hot updates without a full page reload.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-f9txtpa5?file=src%2Fcomponents%2FExample.module.scss
Participation
- I am willing to submit a pull request for this issue.
danivicario
Metadata
Metadata
Assignees
Labels
- P3: minor bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)feat: hmrRelated to HMR (scope)Related to HMR (scope)feat: stylingRelated to styles (scope)Related to styles (scope)