From 22cb4b7b320428378633a3044f07a548dbbc8dc2 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 26 Apr 2022 15:59:31 -0400 Subject: [PATCH] Prevent watcher from running during the build (#3207) * Prevent watcher from running during the build * Adds a changeset --- .changeset/big-ducks-search.md | 5 +++++ packages/astro/src/core/create-vite.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/big-ducks-search.md diff --git a/.changeset/big-ducks-search.md b/.changeset/big-ducks-search.md new file mode 100644 index 000000000000..917145081f4f --- /dev/null +++ b/.changeset/big-ducks-search.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Disables file watching during the build diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 982421043ee6..cbb9bd0ddb74 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -83,6 +83,10 @@ export async function createVite( proxy: { // add proxies here }, + watch: { + // Prevent watching during the build to speed it up + ignored: mode === 'build' ? ['**'] : undefined, + } }, css: { postcss: astroConfig.style.postcss || {},