A bunch of shit
This commit is contained in:
+28
-1
@@ -1,3 +1,30 @@
|
||||
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';
|
||||
|
||||
export default defineConfig({});
|
||||
const viteWispServer = (): Plugin => {
|
||||
return {
|
||||
name: 'vite-wisp-server',
|
||||
configureServer(server) {
|
||||
server.httpServer?.on('upgrade', (req, socket, head) => {
|
||||
console.log('3');
|
||||
req.url.startsWith('/wisp') ? wisp.routeRequest(req, socket, head) : undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
vite: {
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
viteWispServer()
|
||||
]
|
||||
},
|
||||
output: 'server',
|
||||
adapter: node({
|
||||
mode: 'middleware'
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user