-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathtsup.config.ts
More file actions
32 lines (28 loc) · 820 Bytes
/
tsup.config.ts
File metadata and controls
32 lines (28 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { readFileSync } from 'node:fs';
import { defineConfig } from 'tsup';
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
const clientTypeMap = {
dxt: 'Claude Desktop Extension',
mcpb: 'Claude Desktop (MCPB)',
npm: 'PageIndex MCP',
};
const clientType = process.env.CLIENT_TYPE || 'npm';
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm'],
target: 'es2022',
outDir: 'build',
clean: true,
dts: true,
sourcemap: true,
noExternal: [/.*/], // Bundle all dependencies
define: {
__VERSION__: `"${packageJson.version}"`,
__CLIENT_TYPE__: `"${clientType}"`,
__CLIENT_NAME__: `"${clientTypeMap[clientType] || clientTypeMap.npm}"`,
},
platform: 'node',
onSuccess: async () => {
console.log('Build completed successfully!');
},
});