From cec2d737150d5364788e9c4b0892cb03424088da Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 26 Jul 2022 13:28:14 -0400 Subject: [PATCH] Prevent Svelte HMR warning during the build --- .changeset/lucky-phones-mix.md | 5 +++++ packages/integrations/svelte/src/index.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/lucky-phones-mix.md diff --git a/.changeset/lucky-phones-mix.md b/.changeset/lucky-phones-mix.md new file mode 100644 index 000000000000..9c8f18e2dbc5 --- /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 3aa27e47e3bc..367eeb1edab8 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; if (!options) {