import fs from 'node:fs'; import { defineConfig } from 'tsup'; const { version } = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')) as { version: string; }; export default defineConfig({ entry: ['src/cli.ts'], format: ['esm'], target: 'node20', clean: true, // One self-contained file: install copies it next to the payload, where no // node_modules exist. The tool only uses Node's built-in modules. noExternal: [/.*/], define: { __WAGGLE_SERVER_VERSION__: JSON.stringify(version), }, banner: { js: '#!/usr/bin/env node', }, });