summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-04-26 15:59:31 -0400
committerGravatar GitHub <noreply@github.com> 2022-04-26 15:59:31 -0400
commit22cb4b7b320428378633a3044f07a548dbbc8dc2 (patch)
treeabbca6c626f983134f8dedf49859b47580beb4b5
parent18762d6a0a3745f9c96b4a159624003be0f6a5f9 (diff)
downloadastro-22cb4b7b320428378633a3044f07a548dbbc8dc2.tar.gz
astro-22cb4b7b320428378633a3044f07a548dbbc8dc2.tar.zst
astro-22cb4b7b320428378633a3044f07a548dbbc8dc2.zip
Prevent watcher from running during the build (#3207)
* Prevent watcher from running during the build * Adds a changeset
-rw-r--r--.changeset/big-ducks-search.md5
-rw-r--r--packages/astro/src/core/create-vite.ts4
2 files changed, 9 insertions, 0 deletions
diff --git a/.changeset/big-ducks-search.md b/.changeset/big-ducks-search.md
new file mode 100644
index 000000000..917145081
--- /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 982421043..cbb9bd0dd 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 || {},