75 lines
1.8 KiB
JavaScript
75 lines
1.8 KiB
JavaScript
import { defineConfig } from 'astro/config'
|
|
import unocss from 'unocss/astro'
|
|
import solidJs from '@astrojs/solid-js'
|
|
import node from '@astrojs/node'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
import vercel from '@astrojs/vercel/edge'
|
|
import netlify from '@astrojs/netlify/edge-functions'
|
|
import disableBlocks from './plugins/disableBlocks'
|
|
|
|
const envAdapter = () => {
|
|
if (process.env.OUTPUT === 'vercel') {
|
|
return vercel()
|
|
} else if (process.env.OUTPUT === 'netlify') {
|
|
return netlify()
|
|
} else {
|
|
return node({
|
|
mode: 'standalone',
|
|
})
|
|
}
|
|
}
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
integrations: [
|
|
unocss(),
|
|
solidJs(),
|
|
],
|
|
// output: 'server',
|
|
adapter: envAdapter(),
|
|
server: {
|
|
host: '0.0.0.0',
|
|
},
|
|
vite: {
|
|
plugins: [
|
|
process.env.OUTPUT === 'vercel' && disableBlocks(),
|
|
process.env.OUTPUT === 'netlify' && disableBlocks('netlify'),
|
|
process.env.OUTPUT !== 'netlify' && VitePWA({
|
|
registerType: 'autoUpdate',
|
|
manifest: {
|
|
name: 'Ansnid',
|
|
short_name: 'Ansnid',
|
|
description: 'Ansnid is a fully optimized UI for AI Chats.',
|
|
theme_color: '#101010',
|
|
background_color: '#ffffff',
|
|
icons: [
|
|
{
|
|
src: 'pwa-192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png',
|
|
},
|
|
{
|
|
src: 'pwa-512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
},
|
|
{
|
|
src: 'logo.svg',
|
|
sizes: '32x32',
|
|
type: 'image/svg',
|
|
purpose: 'any maskable',
|
|
},
|
|
],
|
|
},
|
|
client: {
|
|
installPrompt: true,
|
|
periodicSyncForUpdates: 20,
|
|
},
|
|
devOptions: {
|
|
enabled: false,
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
})
|