-
-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
We're trying to use tsup to bundle typebox (which is an ESM only library) into a CommonJS library. This works well for the code itself, however we also need to include or generate the type declaration files of typebox to allow its types propagate to consumers.
Is there a way of doing that? It seems that just enabled dts doesn't do the trick.
This is the configuration file I'm using:
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: {
tsconfig: './tsconfig.lib.json',
},
sourcemap: true,
clean: true,
splitting: false,
treeshake: true,
minify: false,
target: 'es2022',
noExternal: ['typebox'],
esbuildOptions(options) {
options.conditions = ['module']
},
})
Using tsup version 8.5.0.
Metadata
Metadata
Assignees
Labels
No labels