From c5fa385a7d831318669e633b18045efb625e9827 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 31 Oct 2023 01:30:15 -0400 Subject: [PATCH] fix: only enable SSL in development mode --- astro.config.mjs | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index d02771e..bfccaaa 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,30 +1,30 @@ -import { defineConfig } from "astro/config" -import * as fs from "node:fs" +import { defineConfig } from 'astro/config' +import * as fs from 'node:fs' -import react from "@astrojs/react" -import tailwind from "@astrojs/tailwind" -import optimizer from "vite-plugin-optimizer" +import react from '@astrojs/react' +import tailwind from '@astrojs/tailwind' +import optimizer from 'vite-plugin-optimizer' export default defineConfig({ - integrations: [react(), tailwind({ applyBaseStyles: false })], - vite: { - server: { - https: { - cert: fs.readFileSync("./.local-ssl/localhost.pem"), - key: fs.readFileSync("./.local-ssl/localhost-key.pem") - }, - }, - build: { - minify: false - }, - resolve: { - dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"] - }, - plugins: [ - optimizer({ - "node-fetch": - "const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};" - }) - ] - } + integrations: [react(), tailwind({ applyBaseStyles: false })], + vite: { + server: process.env.MODE === 'development' ? { + https: { + cert: fs.readFileSync('./.local-ssl/localhost.pem'), + key: fs.readFileSync('./.local-ssl/localhost-key.pem') + }, + } : {}, + build: { + minify: false + }, + resolve: { + dedupe: ['@lumeweb/libportal', '@lumeweb/libweb', '@lumeweb/libkernel'] + }, + plugins: [ + optimizer({ + 'node-fetch': + 'const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};' + }) + ] + } })