All checks were successful
Build and Deploy Astro Site / deploy (push) Successful in 23s
26 lines
673 B
JavaScript
26 lines
673 B
JavaScript
// astro.config.mjs
|
|
import { defineConfig } from 'astro/config'
|
|
import react from '@astrojs/react'
|
|
import markdoc from '@astrojs/markdoc'
|
|
|
|
// Only import keystatic and node in development
|
|
let keystatic, node
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
keystatic = (await import('@keystatic/astro')).default
|
|
node = (await import('@astrojs/node')).default
|
|
}
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production'
|
|
|
|
const config = {
|
|
output: isProduction ? 'static' : 'server',
|
|
integrations: [react(), markdoc()]
|
|
}
|
|
|
|
if (!isProduction) {
|
|
config.adapter = node({ mode: 'standalone' })
|
|
config.integrations.push(keystatic())
|
|
}
|
|
|
|
export default defineConfig(config) |