Don't run Keystatic in production and export vars
This commit is contained in:
parent
53f7d0b350
commit
c0cecb5632
2 changed files with 47 additions and 6 deletions
|
@ -1,9 +1,11 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
|
||||
const SITE_NAME = import.meta.env.SITE_NAME;
|
||||
const SITE_PROTOCOL = import.meta.env.SITE_PROTOCOL;
|
||||
const SITE_DOMAIN = import.meta.env.SITE_DOMAIN;
|
||||
const SITE_BASE = import.meta.env.SITE_BASE;
|
||||
// Environment Variables
|
||||
import {
|
||||
SITE_PROTOCOL,
|
||||
SITE_DOMAIN,
|
||||
SITE_BASE
|
||||
} from './src/utils/GetConfig'
|
||||
|
||||
// Adapters
|
||||
import node from '@astrojs/node';
|
||||
|
@ -12,21 +14,33 @@ import node from '@astrojs/node';
|
|||
import keystatic from '@keystatic/astro';
|
||||
import mdx from '@astrojs/mdx';
|
||||
import partytown from '@astrojs/partytown';
|
||||
import react from '@astrojs/react';
|
||||
|
||||
export default defineConfig({
|
||||
// Information
|
||||
site: SITE_PROTOCOL + '://' + SITE_DOMAIN,
|
||||
base: SITE_BASE,
|
||||
// Integrations
|
||||
integrations: [
|
||||
mdx(),
|
||||
partytown(),
|
||||
react(),
|
||||
// Disable Keystatic in production
|
||||
// https://keystatic.com/docs/recipes/astro-disable-admin-ui-in-production
|
||||
...(process.env.SKIP_KEYSTATIC ? [] : [keystatic()])
|
||||
],
|
||||
// Server Output
|
||||
output: "hybrid",
|
||||
prefetch: true,
|
||||
adapter: node({
|
||||
mode: 'standalone',
|
||||
}),
|
||||
integrations: [mdx(), partytown()],
|
||||
server: {
|
||||
port: 2014,
|
||||
host: true
|
||||
},
|
||||
// Others
|
||||
devToolbar: {
|
||||
enabled: false
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue