summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-07-26 14:04:26 -0400
committerGravatar GitHub <noreply@github.com> 2022-07-26 14:04:26 -0400
commit40251118f8a6b92b0e42aa3f57140319a848d425 (patch)
tree7148e31ad2dba5d199a50c221ea164ca2f91e592
parent44694d8a9084bb1b09840ec8967edd75fa033174 (diff)
downloadastro-40251118f8a6b92b0e42aa3f57140319a848d425.tar.gz
astro-40251118f8a6b92b0e42aa3f57140319a848d425.tar.zst
astro-40251118f8a6b92b0e42aa3f57140319a848d425.zip
Prevent Svelte HMR warning during the build (#4057)
-rw-r--r--.changeset/lucky-phones-mix.md5
-rw-r--r--packages/integrations/svelte/src/index.ts5
2 files changed, 10 insertions, 0 deletions
diff --git a/.changeset/lucky-phones-mix.md b/.changeset/lucky-phones-mix.md
new file mode 100644
index 000000000..9c8f18e2d
--- /dev/null
+++ b/.changeset/lucky-phones-mix.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/svelte': patch
+---
+
+Remove Svelte HMR warning during the build
diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts
index 3aa27e47e..367eeb1ed 100644
--- a/packages/integrations/svelte/src/index.ts
+++ b/packages/integrations/svelte/src/index.ts
@@ -38,6 +38,11 @@ function getViteConfiguration({
],
};
+ // Disable hot mode during the build
+ if(!isDev) {
+ defaultOptions.hot = false;
+ }
+
let resolvedOptions: Partial<Options>;
if (!options) {