tsdown.config.ts 725 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Build index and the invariant companion as separate single-entry bundles.
  4. * Both entries import src/types.ts (the browser-safe subpath), so a
  5. * multi-entry build emits a shared chunk the package's exact `files`
  6. * whitelist omits; separate builds inline it.
  7. */
  8. export default defineConfig([
  9. {
  10. entry: ['lib/types/index.js'],
  11. outDir: 'lib',
  12. format: ['esm'],
  13. platform: 'node',
  14. target: 'es2024',
  15. fixedExtension: false,
  16. dts: false,
  17. clean: false,
  18. },
  19. {
  20. entry: ['lib/types/invariant.js'],
  21. outDir: 'lib',
  22. format: ['esm'],
  23. platform: 'node',
  24. target: 'es2024',
  25. fixedExtension: false,
  26. dts: false,
  27. clean: false,
  28. },
  29. ])