Support for @vercel/nft integration with tsdown for file tracing and tree shaking without bundling #635
Replies: 11 comments
-
|
Can this feature be implemented by a Rolldown plugin? |
Beta Was this translation helpful? Give feedback.
-
|
I don't know anything about it. But I think local support would be very good. Maybe you're right. |
Beta Was this translation helpful? Give feedback.
-
|
We don't have the bandwidth to work on this feature right now, but if there's a plugin like this in the community, PRs are welcome if anyone wants to contribute! |
Beta Was this translation helpful? Give feedback.
-
|
will try to do it |
Beta Was this translation helpful? Give feedback.
-
|
I believe the ideal approach would be to create a separate third-party library (outside of the tsdown repo), which tsdown can reference as an optional peer dependency. |
Beta Was this translation helpful? Give feedback.
-
I also think this can be a ideal approach I would love to work on the library. Just let me know where to start working |
Beta Was this translation helpful? Give feedback.
-
|
@sxzz any update on this ?? |
Beta Was this translation helpful? Give feedback.
-
|
Feel free to get started whenever you like! Just a heads-up: this would be a separate project and isn’t part of tsdown’s current scope. Personally, I’m not especially interested in this feature, but I’m happy to leave it to the community to explore and develop further. |
Beta Was this translation helpful? Give feedback.
-
|
Ok i will create this on my own github and then we will just use it sounds good?? |
Beta Was this translation helpful? Give feedback.
-
|
I think it would be good to have a built-in feature in tsdown itself to place node_modules into dist. A 500 mb file will then be in dist/node_modules in a 1 mb structure. This is my dream, yes maybe it is not possible but it seems like something that has a future. CodeMan62 thank you for taking care of this. I think we'll test it if it's there first, maybe in the future tsdown can have a built-in feature. |
Beta Was this translation helpful? Give feedback.
-
|
A core principle we follow is to separate plugins from the tsdown project whenever possible, so that people who don’t use tsdown can still take advantage of these features seamlessly. For example, rolldown-plugin-dts is both a built-in feature of tsdown and a standalone project. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Clear and concise description of the problem
When building server packages like Hono with tsdown, a large node_modules directory is left in the output. This results in unnecessary bulk and inefficiency in the build output. Additionally, when using tsdown, there is no existing support for integrating @vercel/nft for file tracing and tree shaking, which could further optimize the build process.
Suggested solution
Integrating @vercel/nft with tsdown would allow for a more efficient build by breaking down the node_modules into smaller, optimized parts. Specifically, generating a new node_modules inside the dist folder, broken down with @vercel/nft, would significantly reduce the output size and improve project performance. Providing guidance or support for this integration would be highly beneficial.
Alternative
Additionally, when building server packages like Hono, H3, express etc, breaking down node_modules can be incredibly beneficial, and NitroJS already achieves this.
Additional context
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions