fix: ensure we only use static building

This commit is contained in:
Derrick Hammer 2023-11-01 23:34:03 -04:00
parent 8cd4324508
commit 4d591a6ad9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 27 additions and 26 deletions

View File

@ -1,20 +1,21 @@
import { defineConfig } from "astro/config"; import { defineConfig } from 'astro/config'
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'
import * as fs from "node:fs"; import * as fs from 'node:fs'
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
output: 'static',
integrations: [react(), tailwind({ applyBaseStyles: false })], integrations: [react(), tailwind({ applyBaseStyles: false })],
vite: { vite: {
server: server:
process.env.MODE === "development" 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'),
}, },
} }
: {}, : {},
@ -23,9 +24,9 @@ export default defineConfig({
}, },
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};',
}), }),
], ],
}, },
}); })