diff --git a/vite.config.js b/vite.config.js index 441dd0d..e3ecb00 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,22 +3,21 @@ import { paraglide } from "@inlang/paraglide-sveltekit/vite"; import { sveltekit } from "@sveltejs/kit/vite"; import { defineConfig } from "vitest/config"; -export default defineConfig(async ({ mode }) => { +export default defineConfig(async ({ mode, isPreview }) => { let extraOptions = {}; - switch (mode) { - case "development": - extraOptions = { - ...extraOptions, - server: await getHTTPSAndProxy(), - }; - break; - case "staging": - extraOptions = { - ...extraOptions, - preview: await getHTTPSAndProxy(), - }; - break; + if (mode === "development") { + extraOptions = { + ...extraOptions, + server: await getHTTPSAndProxy(), + }; + } + + if (isPreview) { + extraOptions = { + ...extraOptions, + preview: await getHTTPSAndProxy(), + }; } return {