fix: only enable SSL in development mode
This commit is contained in:
parent
2eabb7926c
commit
c5fa385a7d
|
@ -1,30 +1,30 @@
|
||||||
import { defineConfig } from "astro/config"
|
import { defineConfig } from 'astro/config'
|
||||||
import * as fs from "node:fs"
|
import * as fs from 'node:fs'
|
||||||
|
|
||||||
import react from "@astrojs/react"
|
import react from '@astrojs/react'
|
||||||
import tailwind from "@astrojs/tailwind"
|
import tailwind from '@astrojs/tailwind'
|
||||||
import optimizer from "vite-plugin-optimizer"
|
import optimizer from 'vite-plugin-optimizer'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [react(), tailwind({ applyBaseStyles: false })],
|
integrations: [react(), tailwind({ applyBaseStyles: false })],
|
||||||
vite: {
|
vite: {
|
||||||
server: {
|
server: process.env.MODE === 'development' ? {
|
||||||
https: {
|
https: {
|
||||||
cert: fs.readFileSync("./.local-ssl/localhost.pem"),
|
cert: fs.readFileSync('./.local-ssl/localhost.pem'),
|
||||||
key: fs.readFileSync("./.local-ssl/localhost-key.pem")
|
key: fs.readFileSync('./.local-ssl/localhost-key.pem')
|
||||||
},
|
},
|
||||||
},
|
} : {},
|
||||||
build: {
|
build: {
|
||||||
minify: false
|
minify: false
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"]
|
dedupe: ['@lumeweb/libportal', '@lumeweb/libweb', '@lumeweb/libkernel']
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
optimizer({
|
optimizer({
|
||||||
"node-fetch":
|
'node-fetch':
|
||||||
"const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};"
|
'const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};'
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue