tsdown.config.ts 547 B

1234567891011121314151617
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Schemastery publishes dual-format output (package.json: main → lib/index.cjs,
  4. * module → lib/index.mjs). The entry is the JS emitted by tsc under lib/types;
  5. * pin the bundled extensions explicitly so the package retains both formats.
  6. */
  7. export default defineConfig({
  8. entry: ['lib/types/index.js'],
  9. outDir: 'lib',
  10. format: ['esm', 'cjs'],
  11. platform: 'node',
  12. target: 'es2024',
  13. outExtensions: ({ format }) => ({ js: format === 'es' ? '.mjs' : '.cjs' }),
  14. dts: false,
  15. clean: false,
  16. })