What's the optimal way to use tsdown with typescript project references? #215
Replies: 3 comments 1 reply
-
|
Sorry for the late response ! tsdown doesn't rely on tsc to bundle your source files, but uses oxc-transformer instead (which is why it is generally faster that other tools). Thus, tsc should only be used in your project to do type checking, so you're typical package.json should be : {
"script": {
"build": "tsdown",
"typecheck": "tsc --noEmit"
}
}Type checking and building your package are then 2 different processes (which you can run together if you want). But overall, I think we need proper documentation (and a starter) to help using tsdown in monorepos. |
Beta Was this translation helpful? Give feedback.
-
|
Best practices for monorepo setups will be published in the documentation soon. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @sxzz , I have a similar problem. I use tools like Hono/Trpc to provide APIs, so I not only need to package the server application, but also need to export the Trpc type for react/vue to use. Is the following approach the best practice? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently using tsdown in a monorepo where workspace packages have dependencies between each other. So before running tsdown, I need to first run tsc --build in order to build the dependencies for a given package, and then I have to run tsdown, which I assume has to run tsc a second time for bundling the package.
So what is the right way to manage this kind of workflow? Is it possible to make tsdown run tsc --build instead of just tsc so that it automatically builds the dependencies before bundling the package?
Beta Was this translation helpful? Give feedback.
All reactions