I have a VSCode extension installed called History. It's damn useful because it creates a copy of every single file I touch, which saved me a couple of times when I accidentally removed a file that was not committed yet.
This extension creates a folder called .history, which I obviously ignore at the global level to avoid accidentally committing it to any project. Still, some dev servers track the whole folder for changes, and that was Astro's case.
Because Astro uses Vite, we can ignore certain files from the watch mode:
astro.config.mjs
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
// https://astro.build/config
export default defineConfig({
integrations: [tailwind()],
vite: {
server: {
watch: {
ignored: ["**/.history/**/*"], // HERE
},
},
},
});
And now any file in that folder will be simply ignored.