2026-03-05 19:35:02 +01:00
|
|
|
import { defineConfig } from 'astro/config';
|
2026-03-05 22:22:32 +01:00
|
|
|
import { loadEnv } from 'vite';
|
2026-03-05 19:35:02 +01:00
|
|
|
import tailwindcss from '@tailwindcss/vite';
|
2026-03-05 22:22:32 +01:00
|
|
|
import mkcert from 'vite-plugin-mkcert';
|
2026-03-05 19:35:02 +01:00
|
|
|
import icon from 'astro-icon';
|
2026-03-05 22:22:32 +01:00
|
|
|
import node from '@astrojs/node';
|
|
|
|
|
import { storyblok } from '@storyblok/astro';
|
|
|
|
|
|
|
|
|
|
const env = loadEnv('', process.cwd(), 'STORYBLOK');
|
|
|
|
|
const isPreview = env.STORYBLOK_IS_PREVIEW === 'true';
|
2026-03-05 19:35:02 +01:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-03-05 22:22:32 +01:00
|
|
|
output: isPreview ? 'server' : 'static',
|
|
|
|
|
...(isPreview && { adapter: node({ mode: 'standalone' }) }),
|
|
|
|
|
integrations: [
|
|
|
|
|
icon(),
|
|
|
|
|
storyblok({
|
|
|
|
|
accessToken: env.STORYBLOK_TOKEN,
|
|
|
|
|
bridge: isPreview,
|
|
|
|
|
livePreview: isPreview,
|
|
|
|
|
}),
|
|
|
|
|
],
|
2026-03-05 19:35:02 +01:00
|
|
|
vite: {
|
2026-03-05 22:22:32 +01:00
|
|
|
plugins: [tailwindcss(), ...(isPreview ? [mkcert()] : [])],
|
2026-03-05 19:35:02 +01:00
|
|
|
},
|
|
|
|
|
});
|