This is really just a suggestion based on a use case that I realized. I don't believe it's been asked before, but a system for supporting dependencies of packages in a workspace/monorepo being built with tsup
would be useful.
Currently, I have packageA
which uses packageB
and packageC
, these are all in a monorepo, and they are all built using tsup --watch
. Because packageA
will not rebuild/rerun its onSuccess hook when packageB
or packageC
have changes and recompile, we ended up writing a tool in that workspace which wraps the build()
function and uses TCP to tell other instances of the tool to rebuild and rerun the onSuccess hook.
TCP isn't a great option, but maybe adding direct support for a "dependencies" array that take the directories of other projects, or their paths to tsup.config.ts/js/whatever
. Maybe something like this (rough idea):
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['./src/index.ts'],
format: 'esm'
platform: 'node',
onSuccess: 'node --enable-source-maps --inspect=0.0.0.0 ./dist/index.js',
dependencies: [{
path: '/Users/tale/monorepo/projectB',
configPath: '/Users/tale/monorepo/projectB/tsup.ts' // Optional but equivalent to --config
}]
})
I haven't completely panned this out in my head, but I wanted to start the discussion to see if this is something that can be considered in-scope with the project, and if so, I'd be willing to contribute and implement this.
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