Open tale opened 9 months ago
I think simply allowing us to monitor file changes in node_modules might be sufficient to trigger the build. Right now watch ignores the node_modules folder. Is there a way to ignore it?
I don't think node_modules would suffice because in something like a PNPM repo, workspaces are linked directly from their source. Internally our tool is watching for something like this:
If projectA
depends on projectB
, I have chokidar watching /packages/projectB/dist
to detect rebuilds of projectB
and then it'll rerun (without rebuilding).
Something like a notIgnoreWatching
option should do the work.
Like
{
"notIgnoreWatching": [
"@myMonorepo/myPackage"
]
}
I don't think node_modules would suffice because in something like a PNPM repo, workspaces are linked directly from their source. Internally our tool is watching for something like this:
If
projectA
depends onprojectB
, I have chokidar watching/packages/projectB/dist
to detect rebuilds ofprojectB
and then it'll rerun (without rebuilding).
@tale I did some test and watching package-b/dist
actually will trigger the rebuild of the package using it.
# in package a
tsup --watch . --watch "../package-b/dist/**"
so I think for now it could be a workaround until we automatically do that
It would be nice to override the default ignore (node_modules)
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 usespackageB
andpackageC
, these are all in a monorepo, and they are all built usingtsup --watch
. BecausepackageA
will not rebuild/rerun its onSuccess hook whenpackageB
orpackageC
have changes and recompile, we ended up writing a tool in that workspace which wraps thebuild()
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):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.
Upvote & Fund