-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsup.config.ts
More file actions
53 lines (43 loc) · 1.46 KB
/
tsup.config.ts
File metadata and controls
53 lines (43 loc) · 1.46 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* tsup Build Configuration
*
* This configuration handles the bundling of the FAIM MCP server.
* It generates both ESM and CommonJS outputs with full TypeScript support.
*
* Output files:
* - dist/index.js (ESM)
* - dist/index.cjs (CommonJS)
* - dist/index.d.ts (TypeScript declarations)
* - dist/index.d.cts (CommonJS declarations)
* - Source maps for debugging in production
*/
import { defineConfig } from 'tsup';
export default defineConfig({
// Entry point: src/index.ts is the main server file
entry: ['src/index.ts'],
// Generate both ESM and CommonJS formats
// ESM is for modern tools and direct imports
// CJS is for CommonJS-based projects
format: ['esm', 'cjs'],
// Enable TypeScript declaration files
// Allows consumers to have full type support
dts: true,
// Clean output directory before build
// Ensures no stale files from previous builds
clean: true,
// Generate source maps for debugging
// Points back to original TypeScript files in production
sourcemap: true,
// Shim module exports for ESM-only packages
// Helps with compatibility between ESM and CJS
shims: true,
// Target modern JavaScript (Node 20)
// All modern features are available
target: 'es2020',
// Preserve import/export statements
// Allows tree-shaking by consumers
splitting: false,
// Don't bundle dependencies
// Consumers will install them separately
external: ['@anthropic-ai/sdk', '@faim-group/sdk-forecasting'],
});