Skip to content

Commit

Permalink
Load development certificates for isPreview only
Browse files Browse the repository at this point in the history
  • Loading branch information
wojexe committed Sep 3, 2024
1 parent a426829 commit ea1e0e6
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ea1e0e6

Please sign in to comment.