tsdown.config.ts 1.1 KB

12345678910111213141516171819202122232425262728
  1. import { defineConfig } from 'tsdown'
  2. /**
  3. * JS bundling for all workspace packages (vendor and the packages hierarchy).
  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: `workspace: true` would also discover examples (any
  13. // package.json), but only vendor and the packages hierarchy are pnpm
  14. // workspaces. The Landlock launcher platform packages ship a prebuilt
  15. // native binary and no JavaScript — nothing to bundle.
  16. workspace: ['vendor/*', 'packages/*/*'],
  17. entry: ['lib/types/index.js'],
  18. outDir: 'lib',
  19. format: ['esm'],
  20. platform: 'node',
  21. target: 'es2024',
  22. // All packages set "type": "module"; fixedExtension false keeps ESM output
  23. // at .js (not .mjs), matching the package.json main/exports fields.
  24. fixedExtension: false,
  25. dts: false,
  26. clean: false,
  27. })