Skip to content

Migrate from rolldown to tsdown#4025

Open
nstepien wants to merge 1 commit intomainfrom
tsdown
Open

Migrate from rolldown to tsdown#4025
nstepien wants to merge 1 commit intomainfrom
tsdown

Conversation

@nstepien
Copy link
Copy Markdown
Collaborator

@nstepien nstepien commented Apr 1, 2026

  • rolldown dropped support for CSS, unclear when it'll be restored, if ever
  • vite's library mode does not support outputting declaration files
  • tsdown, built on top of rolldown, is the ideal lib bundling tool for rdg

https://tsdown.dev/
https://github.com/rolldown/tsdown

before

<DIR>/styles.css      asset │ size:   9.78 kB
<DIR>/styles.css.map  asset │ size:  12.75 kB
<DIR>/index.js.map    asset │ size: 216.46 kB
<DIR>/index.d.ts      chunk │ size:  23.08 kB
<DIR>/index.js        chunk │ size:  99.18 kB

✔ rolldown v1.0.0-rc.5 Finished in 481.46 ms

after

ℹ tsdown v0.21.7 powered by rolldown v1.0.0-rc.12
ℹ config file: D:\repos\react-data-grid\.claude\worktrees\vitelib\tsdown.config.ts 
ℹ entry: src\index.ts
ℹ tsconfig: tsconfig.json
ℹ Build start
ℹ Cleaning 5 files
ℹ lib\index.js       98.39 kB │ gzip: 21.95 kB
ℹ lib\index.js.map  217.24 kB │ gzip: 53.86 kB
ℹ lib\styles.css      8.22 kB │ gzip:  2.12 kB
ℹ lib\index.d.ts     23.10 kB │ gzip:  5.14 kB
ℹ 4 files, total: 346.95 kB
✔ Build complete in 187ms

build output changes

We've lost the sourcemaps for CSS files, not a major concern.

In the JS, besides empty lines being removed, some const values are inlined:

image image

In the declaration file, the name of namespace imports changed, that's it:

image

The CSS file is processed by lightningcss, so it has more changes, but nothing major, some highlights:

image image image image

@nstepien nstepien self-assigned this Apr 1, 2026
@nstepien nstepien marked this pull request as ready for review April 1, 2026 22:49
@nstepien nstepien requested a review from amanmahajan7 as a code owner April 1, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant