tsup.config.ts 667 B

1234567891011121314151617
  1. import { readFileSync } from 'node:fs'
  2. import { defineConfig } from 'tsup'
  3. const { version } = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) as { version: string }
  4. // 推送工具打包为一个不带依赖的文件(fflate 一起打包),由 scripts/build-sdk.mjs 放进 dist-sdk 分发(docs/design/19-skill-cli.md)
  5. export default defineConfig({
  6. entry: { 'agent-skills': 'src/bin.ts' },
  7. format: ['esm'],
  8. platform: 'node',
  9. target: 'node18',
  10. outExtension: () => ({ js: '.mjs' }),
  11. noExternal: [/.*/],
  12. banner: { js: '#!/usr/bin/env node' },
  13. define: { __CLI_VERSION__: JSON.stringify(version) },
  14. clean: true,
  15. })