This is a followup on:
https://github.com/egoist/tsup/discussions/793
I have figured out how to generate the mjs
files correctly, but tsup is not using the esbuild config to decide where to output the .d.ts files, so my consumers can't actually use my packages from typescript...
That config in the discussion:
import { defineConfig } from 'tsup'
export default defineConfig([
{
entry: [
"src/*.ts",
],
dts: true,
format: 'esm',
splitting: false,
sourcemap: true,
clean: true,
esbuildOptions(opts, ctx) {
opts.entryNames = "[dir]/[name]/index"
}
},
{
entry: [
"src/*/+(index|worker|*.worker).ts",
],
dts: true,
format: 'esm',
splitting: false,
sourcemap: true,
clean: true,
}
])
Results in src/foobar.ts
being built to dist/foobar/index.mjs
, but the .d.ts file still gets built in dist/foobar.d.ts
which is totally useless.
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