tsdown.config.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * JS bundling for vendored Cordis and Harness TypeScript packages.
  4. * TypeScript source is compiled first by `tsc -b tsconfig.build.json`; tsdown
  5. * reads only the emitted JS under lib/types and writes lib/index.* runtime
  6. * bundles. Declarations are NOT produced here, hence `dts: false`.
  7. *
  8. * Per-package shape overrides live in `<package>/tsdown.config.ts`
  9. * (schemastery: dual ESM+CJS; logger-console: extra browser entry).
  10. */
  11. export default defineConfig({
  12. // Explicit globs keep bundling to vendored Cordis and the TypeScript package tree;
  13. // `workspace: true` would discover package manifests outside that bundle set. Landlock
  14. // platform packages contain only a prebuilt native binary, so they have no JS entry.
  15. workspace: ['vendor/*', 'packages/*/*'],
  16. entry: ['lib/types/index.js'],
  17. outDir: 'lib',
  18. format: ['esm'],
  19. platform: 'node',
  20. target: 'es2024',
  21. // All packages set "type": "module"; fixedExtension false keeps ESM output
  22. // at .js (not .mjs), matching the package.json main/exports fields.
  23. fixedExtension: false,
  24. dts: false,
  25. clean: false,
  26. })