Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
24 lines
620 B
TypeScript
24 lines
620 B
TypeScript
import { defineConfig } from 'tsup';
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
export default defineConfig({
|
|
entry: ['src/tsup.base.ts'],
|
|
format: ['esm', 'cjs'],
|
|
target: 'node18',
|
|
// Sourcemaps only in development
|
|
sourcemap: !isProduction,
|
|
clean: true,
|
|
dts: true,
|
|
// Enable minification in production
|
|
minify: isProduction,
|
|
treeshake: isProduction,
|
|
external: ['tsup'],
|
|
esbuildOptions(options) {
|
|
// Better source mapping in development only
|
|
options.sourcesContent = !isProduction;
|
|
// Keep original names for better debugging in development
|
|
options.keepNames = !isProduction;
|
|
}
|
|
});
|