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.
![Astro dev server - update when .history file has changed](/_vercel/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fgc3hakk3%2Fproduction%2Fe3820677298c2b2140ba946c8b569d9d076450a4-705x202.png%3Fw%3D705%26h%3D202%26auto%3Dformat&w=768&q=100)
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.