simplify ui build

This commit is contained in:
ochafik 2025-11-23 03:27:46 +00:00
commit adc73e4fa6
4 changed files with 6 additions and 8 deletions

View file

@ -4,11 +4,9 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "rm -rf dist && VITE_ENTRY=ui-raw vite build && VITE_ENTRY=ui-vanilla vite build && VITE_ENTRY=ui-react vite build",
"preview": "vite preview",
"build:uis": "rm -rf dist && concurrently 'UI=ui-raw.html vite build' 'UI=ui-vanilla.html vite build' 'UI=ui-react.html vite build'",
"server": "bun server.ts",
"start": "npm run build && npm run server"
"start": "npm run build:uis && npm run server"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
@ -23,6 +21,7 @@
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
"typescript": "^5.7.2",

View file

@ -280,7 +280,6 @@ app.delete("/mcp", async (req: Request, res: Response) => {
app.listen(MCP_PORT, () => {
console.log(`MCP Server listening on http://localhost:${MCP_PORT}/mcp`);
console.log(` Tools: create-ui-vanilla, create-ui-react, get-weather`);
});
process.on("SIGINT", async () => {

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCP UI Client (Vanilla)</title>
<title>MCP UI Client (Raw)</title>
</head>
<body>
<div id="root"></div>

View file

@ -4,13 +4,13 @@ import { viteSingleFile } from "vite-plugin-singlefile";
import { resolve } from "path";
// Get the entry from environment variable, default to ui-react
const entry = process.env.VITE_ENTRY || "ui-react";
const uiPath = process.env.UI;
export default defineConfig({
plugins: [react(), viteSingleFile()],
build: {
rollupOptions: {
input: resolve(__dirname, `${entry}.html`),
input: uiPath,
},
outDir: `dist`,
emptyOutDir: false,