-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
28 lines (27 loc) · 857 Bytes
/
tsup.config.ts
File metadata and controls
28 lines (27 loc) · 857 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
import {defineConfig} from 'tsup';
import pkg from './package.json';
import {generateBanner} from "@phucbm/banner";
export default defineConfig([
// ESM build
{
entry: ['src/index.ts'],
outDir: 'dist',
format: ['esm'],
target: 'es2020',
platform: 'node',
bundle: true,
minify: true,
sourcemap: true,
dts: true,
clean: true,
outExtension: () => ({js: '.js'}),
banner: {js: generateBanner()},
onSuccess: async () => {
console.log('✅ ESM build completed');
console.log(`\n🎉 ${pkg.description} v${pkg.version} - Build completed successfully!\n`);
console.log(`📦 Generated files:`);
console.log(` • dist/index.js`);
console.log(` • dist/index.d.ts\n`);
}
}
]);