import { defineConfig } from 'tsup'

export default defineConfig({
	entry: ['src/index.ts'],
	format: ['cjs'],
	target: 'node22',
	outDir: 'dist',
	clean: true,
	minify: true,
	sourcemap: false,
	splitting: false,
	treeshake: true,
	bundle: true,
	platform: 'node',
	external: [
		'bufferutil',
		'zlib-sync'
	],
	esbuildOptions(options) {
		options.banner = {
			js: '#!/usr/bin/env node'
		}
		options.alias = {
			'@': './src'
		}
		options.target = 'es2022'
	}
})
