tsdown.config.ts 762 B

1234567891011121314151617181920212223
  1. import type { UserConfig } from 'tsdown'
  2. import { clientBundle } from '../tsdown.client.ts'
  3. /**
  4. * Standard dual-entry shape plus the loader lib half: exports["./loader"]
  5. * promises lib/loader.js (the web shell statically imports the machinery —
  6. * a loader cannot load itself), and the shared preset only emits
  7. * lib/{index,invariant}.js, so the extra config supplies it.
  8. */
  9. const configs = clientBundle('@deepseek-ai/dsh-client-runtime', ['lib/types/index.js', 'lib/types/invariant.js'])
  10. const loaderLib: UserConfig = {
  11. entry: { loader: 'lib/types/client/loader/index.js' },
  12. outDir: 'lib',
  13. format: ['esm'],
  14. platform: 'neutral',
  15. target: 'es2024',
  16. fixedExtension: false,
  17. dts: false,
  18. clean: false,
  19. }
  20. export default [...configs, loaderLib]