From f8768f5855a36f40928316ed04594d69d43b49cc Mon Sep 17 00:00:00 2001 From: Taj Date: Tue, 5 Aug 2025 16:42:55 +0530 Subject: [PATCH] feat: Configure tsup for build process This commit introduces a tsup.config.ts file to centralize the build configuration for the project. The build and dev scripts in package.json have been updated to simply invoke tsup, leveraging the new configuration file for detailed build settings. --- package.json | 4 ++-- tsup.config.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tsup.config.ts diff --git a/package.json b/package.json index f31f283..29e60a9 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "dist" ], "scripts": { - "build": "tsup src/index.ts --format esm,cjs --dts", - "dev": "tsup src/index.ts --watch --format esm,cjs", + "build": "tsup", + "dev": "tsup --watch", "test": "vitest run", "clean": "rm -rf dist", "prepare": "pnpm build" diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..a3e8151 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,17 @@ +import { defineConfig } from 'tsup'; +import pkg from './package.json'; + +export default defineConfig((options) => ({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + dts: true, + watch: options.watch, + clean: true, + banner: { + js: `/** + * ${pkg.name} v${pkg.version} + * Author: ${pkg.author} + */ + `, + }, +})); \ No newline at end of file