Minimal reproduction -
File structure
tsup.config.ts
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['lib', 'types'],
dts: true,
})
types/helpers.ts (only contains types)
export type Optional<T> = T | null | undefined
lib/index.ts
import { Optional } from '../types/helpers'
export function log(message?: Optional<string>) {
console.log(message ?? '<no-message>')
}
This will output helpers.js with empty exports or full empty file if using esm format
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too