fix: only enable SSL in development mode

This commit is contained in:
Derrick Hammer 2023-10-31 01:30:15 -04:00
parent 2eabb7926c
commit c5fa385a7d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 26 additions and 26 deletions

View File

@ -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};'
})
]
}
})