esbuild instead of tsc

This commit is contained in:
azykov@mail.ru
2026-07-01 13:29:04 +03:00
parent 0d2b6f6067
commit 464d66d82e
5 changed files with 21 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
// build.js
import { build } from 'esbuild';
build({
entryPoints: ['src/index.ts'],
bundle: true,
platform: 'node',
target: 'node22',
format: 'esm',
outfile: 'dist/index.js',
sourcemap: true,
packages: 'external',
}).catch(() => process.exit(1));
+3 -2
View File
@@ -4,11 +4,11 @@
"description": "",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"build": "tsc && node build.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
@@ -27,6 +27,7 @@
"devDependencies": {
"@eslint/js": "^9.21.0",
"@types/node": "^22.13.5",
"esbuild": "^0.28.1",
"eslint": "^9.21.0",
"pino-pretty": "^13.1.3",
"tsx": "^4.19.3",
+3
View File
@@ -226,6 +226,9 @@ importers:
'@types/node':
specifier: ^22.13.5
version: 22.20.0
esbuild:
specifier: ^0.28.1
version: 0.28.1
eslint:
specifier: ^9.21.0
version: 9.39.4
+1 -1
View File
@@ -1,7 +1,7 @@
import Fastify, { type FastifyInstance } from "fastify";
import { ToolDef } from "./types";
import McpSession from "./mcpConnection";
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types";
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
import { pingTool, testAddTool, testRemoveTool, listToolsTool, invokeToolTool } from "./mcpTools";
export class Server {
+1
View File
@@ -6,6 +6,7 @@
"lib": ["ES2022"],
"outDir": "dist",
"rootDir": "src",
"noEmit": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,