Replacement for vite-plugin-dts with rollupTypes: true for vite 8 beta/vite-rolldown?
#21667
-
|
Is there a replacement to bundle all d.ts into one for vite-rolldown or for vite 8 beta? I'm using https://www.npmjs.com/package/vite-plugin-dts but I couldn't found a replacement for rolldown to migrate to it.
Is there a faster alternative to |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
You probably want https://github.com/rolldown/tsdown, vite is incapable of emitting type definitions. |
Beta Was this translation helpful? Give feedback.
-
|
For Vite 8/rolldown migration, a practical path is:
Example pipeline: {
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly",
"types:bundle": "api-extractor run --local"
}This avoids Also worth checking:
In short: JS bundle with Vite, types with tsc/API Extractor is currently the most predictable and usually faster path. |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/sxzz/rolldown-plugin-dts might also be an option, it's what tsdown uses to generate dts, not sure if it has a equivalent to |
Beta Was this translation helpful? Give feedback.
For Vite 8/rolldown migration, a practical path is:
tsc(fast + stable), and let Vite/rolldown handle JS bundling..d.ts, run API Extractor as a post-step.Example pipeline:
{ "build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly", "types:bundle": "api-extractor run --local" }This avoids
vite-plugin-dtsbottlenecks while preserving bundled type output when needed.Also worth checking:
skipLibCheckonly for app projects (not libraries)tsconfig.build.jsonwith narrowincludeIn short: JS bundle with Vite, types with tsc/API Extractor is currently the most predictable a…