File tree Expand file tree Collapse file tree
packages/astro/src/vite-plugin-astro Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' astro ' : patch
3+ ---
4+
5+ Fixes an issue where the dev server logged the full file path on updates.
Original file line number Diff line number Diff line change 1+ import { slash } from '@astrojs/internal-helpers/path' ;
12import { fileURLToPath } from 'node:url' ;
23import type { HmrContext , ModuleNode } from 'vite' ;
34import type { AstroConfig } from '../@types/astro.js' ;
@@ -91,7 +92,7 @@ export async function handleHotUpdate(
9192 // Bugfix: sometimes style URLs get normalized and end with `lang.css=`
9293 // These will cause full reloads, so filter them out here
9394 const mods = [ ...filtered ] . filter ( ( m ) => ! m . url . endsWith ( '=' ) ) ;
94- const file = ctx . file . replace ( config . root . pathname , '/' ) ;
95+ const file = ctx . file . replace ( slash ( fileURLToPath ( config . root ) ) , '/' ) ;
9596
9697 // If only styles are changed, remove the component file from the update list
9798 if ( isStyleOnlyChange ) {
You can’t perform that action at this time.
0 commit comments