tsdown.config.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Root shape plus the store subpath, built as SEPARATE single-entry bundles:
  4. * a multi-entry build emits a hash-named shared chunk that the exact `files`
  5. * whitelist cannot publish (same shape as code-runtime-worker/user-approval).
  6. * Each entry inlines the shared store code instead; the node lib is the
  7. * repo-uniform shape (publint/NodeNext), not an identity-sensitive runtime —
  8. * browser consumers resolve this package through the loader module table.
  9. */
  10. export default defineConfig([
  11. {
  12. entry: { index: 'lib/types/index.js' },
  13. outDir: 'lib',
  14. format: ['esm'],
  15. platform: 'neutral',
  16. target: 'es2024',
  17. fixedExtension: false,
  18. dts: false,
  19. clean: false,
  20. },
  21. {
  22. entry: { invariant: 'lib/types/invariant.js' },
  23. outDir: 'lib',
  24. format: ['esm'],
  25. platform: 'neutral',
  26. target: 'es2024',
  27. fixedExtension: false,
  28. dts: false,
  29. clean: false,
  30. },
  31. {
  32. entry: { 'store/index': 'lib/types/store/index.js' },
  33. outDir: 'lib',
  34. format: ['esm'],
  35. platform: 'neutral',
  36. target: 'es2024',
  37. fixedExtension: false,
  38. dts: false,
  39. clean: false,
  40. },
  41. ])