tsdown.config.ts 905 B

1234567891011121314151617181920212223242526272829303132
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * The engine ships two runtime entries: the engine service (index) and the
  4. * worker-thread entry (worker) the engine spawns via `new Worker`. The
  5. * entries are JS emitted by tsc under lib/types and are bundled as two
  6. * single-entry passes so shared modules (realm, runtime, session) are inlined
  7. * into each instead of split into a hash-named chunk (the worker entry must
  8. * be a self-contained file the Worker constructor can load by path).
  9. */
  10. export default defineConfig([
  11. {
  12. entry: ['lib/types/index.js'],
  13. outDir: 'lib',
  14. format: ['esm'],
  15. platform: 'node',
  16. target: 'es2024',
  17. fixedExtension: false,
  18. dts: false,
  19. clean: false,
  20. },
  21. {
  22. entry: ['lib/types/worker.js'],
  23. outDir: 'lib',
  24. format: ['esm'],
  25. platform: 'node',
  26. target: 'es2024',
  27. fixedExtension: false,
  28. dts: false,
  29. clean: false,
  30. },
  31. ])