vite.config.ts•902 B
import { resolve } from "node:path";
import { defineConfig } from "vite";
import swcImport from "vite-plugin-swc";
const swcPlugin = typeof swcImport === "function" ? swcImport : (swcImport as { default: () => any }).default;
export default defineConfig({
plugins: [
swcPlugin({
swcOptions: {
jsc: {
parser: {
syntax: "typescript"
},
target: "es2022"
}
}
})
],
build: {
outDir: "dist",
emptyOutDir: true,
target: "esnext",
sourcemap: true,
lib: {
entry: resolve(__dirname, "src/server.ts"),
formats: ["es"],
fileName: () => "server.mjs"
},
rollupOptions: {
external: [
/^node:/,
"@modelcontextprotocol/sdk",
"@modelcontextprotocol/sdk/server/mcp.js",
"@modelcontextprotocol/sdk/server/stdio.js",
"zod"
]
}
}
});