tsdown.config.ts 679 B

1234567891011121314151617181920212223242526272829
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Build the engine and worker separately so each inlines shared modules; a
  4. * multi-entry build creates an unlisted chunk. The path-loaded worker is
  5. * CommonJS because pkg's VFS Worker hook compiles it in that format.
  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. ])