-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtsup.config.ts
26 lines (24 loc) · 902 Bytes
/
tsup.config.ts
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
import { defineConfig } from 'tsup';
import { peerDependencies } from './package.json';
// Extract peerDependencies from package.json
const EXTERNAL_DEPS = Object.keys(peerDependencies as Record<string, string>);
export default defineConfig({
// Entry file(s) for the bundling process
entry: ['src/index.ts'],
// Output directory for the bundled code
outDir: 'dist',
// Enable code splitting for better performance
splitting: true,
// Specify external dependencies to exclude from the bundle
external: EXTERNAL_DEPS,
// Generate source maps
sourcemap: false,
// Clean the output directory before each build if not in a continuous integration environment
clean: true,
// Generate declaration files (.d.ts)
dts: true,
// Output formats: CommonJS and ECMAScript modules
format: ['esm'],
// Minify the code if in a continuous integration environment
minify: true,
});