mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
This commit is contained in:
parent
5c888c10b7
commit
326e178933
2 changed files with 7 additions and 1 deletions
5
.changeset/two-lamps-tell.md
Normal file
5
.changeset/two-lamps-tell.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes an issue where the dev server logged the full file path on updates.
|
|
@ -1,3 +1,4 @@
|
|||
import { slash } from '@astrojs/internal-helpers/path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import type { HmrContext, ModuleNode } from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro.js';
|
||||
|
@ -91,7 +92,7 @@ export async function handleHotUpdate(
|
|||
// Bugfix: sometimes style URLs get normalized and end with `lang.css=`
|
||||
// These will cause full reloads, so filter them out here
|
||||
const mods = [...filtered].filter((m) => !m.url.endsWith('='));
|
||||
const file = ctx.file.replace(config.root.pathname, '/');
|
||||
const file = ctx.file.replace(slash(fileURLToPath(config.root)), '/');
|
||||
|
||||
// If only styles are changed, remove the component file from the update list
|
||||
if (isStyleOnlyChange) {
|
||||
|
|
Loading…
Add table
Reference in a new issue