diff --git a/package.json b/package.json index bb71982cd1..24b075e2ab 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@types/ua-parser-js": "^0.7.36", "@typescript-eslint/eslint-plugin": "6.7.5", "@typescript-eslint/parser": "6.7.5", + "@vitejs/plugin-basic-ssl": "^1.0.1", "@wdio/globals": "^8.6.9", "astro": "^2.4.1", "eslint": "8.51.0", diff --git a/vite.config.ts b/vite.config.ts index 8c1183dd60..7300fcf70b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,3 +1,4 @@ +import basicSsl from "@vitejs/plugin-basic-ssl"; import { resolve } from "path"; import { AliasOptions, defineConfig, UserConfig } from "vite"; import { @@ -58,6 +59,7 @@ export default defineConfig(({ mode }: UserConfig): UserConfig => { plugins: [ [...(mode === "development" ? [injectCanisterIdPlugin()] : [])], [...(mode === "production" ? [minifyHTML(), compression()] : [])], + [...(process.env.TLS_DEV_SERVER === "1" ? [basicSsl()] : [])], ], optimizeDeps: { esbuildOptions: { @@ -67,6 +69,7 @@ export default defineConfig(({ mode }: UserConfig): UserConfig => { }, }, server: { + https: process.env.TLS_DEV_SERVER === "1", proxy: { "/api": "http://127.0.0.1:4943", },