|
1 | 1 | import { defineConfig } from 'tsdown'; |
2 | 2 |
|
3 | 3 | export default defineConfig({ |
4 | | - // 1. Entry Points |
5 | | - // Directly matches package.json include/exclude globs |
6 | | - entry: [ |
7 | | - 'src/**/*.ts', |
8 | | - '!src/**/*.test.ts', |
9 | | - '!src/__mocks__/**', |
10 | | - '!src/examples/**' |
11 | | - ], |
| 4 | + // 1. Entry Points |
| 5 | + // Directly matches package.json include/exclude globs |
| 6 | + entry: ['src/**/*.ts', '!src/**/*.test.ts', '!src/__mocks__/**', '!src/examples/**'], |
12 | 7 |
|
13 | | - // 2. Output Configuration |
14 | | - format: ['esm'], |
15 | | - outDir: 'dist', |
16 | | - clean: true, // Recommended: Cleans 'dist' before building |
17 | | - sourcemap: true, |
18 | | - |
19 | | - // 3. Platform & Target |
20 | | - target: 'esnext', |
21 | | - platform: 'node', |
22 | | - shims: true, // Polyfills common Node.js shims (__dirname, etc.) |
| 8 | + // 2. Output Configuration |
| 9 | + format: ['esm'], |
| 10 | + outDir: 'dist', |
| 11 | + clean: true, // Recommended: Cleans 'dist' before building |
| 12 | + sourcemap: true, |
23 | 13 |
|
24 | | - // 4. Type Definitions |
25 | | - // Bundles d.ts files into a single output |
26 | | - dts: true, |
| 14 | + // 3. Platform & Target |
| 15 | + target: 'esnext', |
| 16 | + platform: 'node', |
| 17 | + shims: true, // Polyfills common Node.js shims (__dirname, etc.) |
27 | 18 |
|
28 | | - // 5. CRITICAL: Vendoring Strategy |
29 | | - // This tells tsdown: "Bundle the code for this specific package into the output, |
30 | | - // but treat all other dependencies as external (require/import)." |
31 | | - noExternal: [ |
32 | | - '@modelcontextprotocol/sdk-core' |
33 | | - ] |
| 19 | + // 4. Type Definitions |
| 20 | + // Bundles d.ts files into a single output |
| 21 | + dts: true, |
| 22 | + |
| 23 | + // 5. CRITICAL: Vendoring Strategy |
| 24 | + // This tells tsdown: "Bundle the code for this specific package into the output, |
| 25 | + // but treat all other dependencies as external (require/import)." |
| 26 | + noExternal: ['@modelcontextprotocol/sdk-core'] |
34 | 27 | }); |
0 commit comments