tsdown.config.ts 608 B

123456789101112131415161718
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * schemastery has no `"type": "module"` and publishes dual-format output
  4. * (package.json: main → lib/index.cjs, module → lib/index.mjs). The entry is
  5. * the JS emitted by tsc under lib/types; pin the bundled extensions
  6. * explicitly because the defaults for a CommonJS package would emit .mjs/.js.
  7. */
  8. export default defineConfig({
  9. entry: ['lib/types/index.js'],
  10. outDir: 'lib',
  11. format: ['esm', 'cjs'],
  12. platform: 'node',
  13. target: 'es2024',
  14. outExtensions: ({ format }) => ({ js: format === 'es' ? '.mjs' : '.cjs' }),
  15. dts: false,
  16. clean: false,
  17. })