diff --git a/.changeset/shiny-teachers-cheer.md b/.changeset/shiny-teachers-cheer.md new file mode 100644 index 00000000000..c7c93ce53ea --- /dev/null +++ b/.changeset/shiny-teachers-cheer.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": patch +--- + +do not trigger rebuilds when .DS_Store changes diff --git a/packages/remix-dev/compiler/watch.ts b/packages/remix-dev/compiler/watch.ts index 0d5d7e88368..cd961ace8e8 100644 --- a/packages/remix-dev/compiler/watch.ts +++ b/packages/remix-dev/compiler/watch.ts @@ -31,6 +31,11 @@ export type WatchOptions = { onFileDeleted?(file: string): void; }; +function shouldIgnore(file: string): boolean { + let filename = path.basename(file); + return filename === ".DS_Store"; +} + export async function watch( ctx: Context, { @@ -120,10 +125,12 @@ export async function watch( }) .on("error", (error) => ctx.logger.error(String(error))) .on("change", async (file) => { + if (shouldIgnore(file)) return; onFileChanged?.(file); await rebuild(); }) .on("add", async (file) => { + if (shouldIgnore(file)) return; onFileCreated?.(file); try { @@ -136,6 +143,7 @@ export async function watch( await (isEntryPoint(ctx.config, file) ? restart : rebuild)(); }) .on("unlink", async (file) => { + if (shouldIgnore(file)) return; onFileDeleted?.(file); await (isEntryPoint(ctx.config, file) ? restart : rebuild)(); });