1
0

tsdown.config.ts 806 B

12345678910111213141516171819202122232425262728293031
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * Node-only backend. The Win32 dialog worker builds as its own CJS entry,
  4. * path-loaded by the driver,
  5. * inlining the dialog logic while koffi stays an external native require.
  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. // The artifact is lib/worker.cjs (the ./worker export the workspace
  20. // constraint keys on), bundled from the descriptive source entry.
  21. entry: { worker: 'lib/types/win32-dialog-worker.js' },
  22. outDir: 'lib',
  23. format: ['cjs'],
  24. platform: 'node',
  25. target: 'es2024',
  26. fixedExtension: false,
  27. dts: false,
  28. clean: false,
  29. },
  30. ])