Add Akkam Bakkam classroom game
Some checks failed
CI / validate (push) Has been cancelled

This commit is contained in:
Neeldhara Misra 2026-07-20 17:23:12 +05:30
parent 52615a5086
commit e6fa86519c
16 changed files with 3277 additions and 6 deletions

View file

@ -5,8 +5,26 @@ import sitemap from "@astrojs/sitemap";
import react from "@astrojs/react";
import tailwindcss from "@tailwindcss/vite";
import { attachDiceSyncServer } from "./server/dice-sync.mjs";
// Admin API runs as a standalone Netlify Function (see netlify/functions/admin.mts)
const attachedServers = new WeakSet();
const classroomSync = () => ({
name: "classroom-dice-sync",
configureServer(server) {
if (server.httpServer && !attachedServers.has(server.httpServer)) {
attachDiceSyncServer(server.httpServer);
attachedServers.add(server.httpServer);
}
},
configurePreviewServer(server) {
if (server.httpServer && !attachedServers.has(server.httpServer)) {
attachDiceSyncServer(server.httpServer);
attachedServers.add(server.httpServer);
}
},
});
// https://astro.build/config
export default defineConfig({
site: "https://interactives.neeldhara.com",
@ -22,14 +40,14 @@ export default defineConfig({
],
vite: {
plugins: [tailwindcss()],
plugins: [tailwindcss(), classroomSync()],
build: {
target: "es2022",
minify: "esbuild",
// Sanitize chunk filenames — Netlify esbuild chokes on ! and ~ in names
rollupOptions: {
output: {
sanitizeFileName: (name) => name.replace(/[^\w./-]/g, '_'),
sanitizeFileName: (name) => name.replace(/[^\w./-]/g, "_"),
},
},
},