Skip to main content
Glama

Cloudflare Remix Vite MCP

by kentcdodds
vite.config.widgets.ts1.12 kB
import fs from 'node:fs' import path from 'node:path' import { defineConfig } from 'vite' // Automatically detect all .tsx files and directories with index.tsx in worker/widgets as build entries const entriesDir = path.resolve(__dirname, 'worker/widgets') const entries = Object.fromEntries( fs.readdirSync(entriesDir).flatMap((item) => { const itemPath = path.join(entriesDir, item) const stat = fs.statSync(itemPath) // If it's a .tsx file, use it directly if (stat.isFile() && item.endsWith('.tsx')) { return [[path.basename(item, '.tsx'), itemPath]] } // If it's a directory with an index.tsx, use that if (stat.isDirectory()) { const indexPath = path.join(itemPath, 'index.tsx') if (fs.existsSync(indexPath)) { return [[item, indexPath]] } } return [] }), ) // https://vite.dev/config/ export default defineConfig({ build: { outDir: 'dist/public', rollupOptions: { input: entries, output: { entryFileNames: 'widgets/[name].js', format: 'es', }, preserveEntrySignatures: 'exports-only', // Preserve exports even if they appear unused }, }, })

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kentcdodds/cloudflare-remix-vite-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server