tsdown.config.ts 748 B

1234567891011121314151617181920212223242526272829
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Build the index and worker as separate single-entry bundles. The sibling `worker.cjs` is loaded
  4. * by file and must be CommonJS for pkg's VFS Worker hook. A multi-entry build emits an unlisted
  5. * shared chunk omitted by the package's exact `files` whitelist; separate builds inline it.
  6. */
  7. export default defineConfig([
  8. {
  9. entry: ['lib/types/index.js'],
  10. outDir: 'lib',
  11. format: ['esm'],
  12. platform: 'node',
  13. target: 'es2024',
  14. fixedExtension: false,
  15. dts: false,
  16. clean: false,
  17. },
  18. {
  19. entry: ['lib/types/worker.js'],
  20. outDir: 'lib',
  21. format: ['cjs'],
  22. platform: 'node',
  23. target: 'es2024',
  24. fixedExtension: false,
  25. dts: false,
  26. clean: false,
  27. },
  28. ])