summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.changeset/two-lamps-tell.md5
-rw-r--r--packages/astro/src/vite-plugin-astro/hmr.ts3
2 files changed, 7 insertions, 1 deletions
diff --git a/.changeset/two-lamps-tell.md b/.changeset/two-lamps-tell.md
new file mode 100644
index 000000000..c79d1764b
--- /dev/null
+++ b/.changeset/two-lamps-tell.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fixes an issue where the dev server logged the full file path on updates.
diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts
index 6600b2f42..27cc2d10f 100644
--- a/packages/astro/src/vite-plugin-astro/hmr.ts
+++ b/packages/astro/src/vite-plugin-astro/hmr.ts
@@ -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) {