nyvora.app/astro.config.ts
2025-03-18 18:28:04 -06:00

31 lines
792 B
TypeScript

import { defineConfig } from 'astro/config';
import type { Plugin } from 'vite';
import wisp from "wisp-server-node";
import node from '@astrojs/node';
import tailwindcss from '@tailwindcss/vite';
import icon from "astro-icon";
const viteWispServer = (): Plugin => {
return {
name: 'vite-wisp-server',
configureServer(server) {
server.httpServer?.on('upgrade', (req, socket, head) => {
req.url.startsWith('/wisp') ? wisp.routeRequest(req, socket, head) : undefined
})
}
}
};
export default defineConfig({
vite: {
plugins: [
tailwindcss(),
viteWispServer()
]
},
integrations: [icon()],
output: 'server',
adapter: node({
mode: 'middleware'
})
});