-
-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Describe the bug
When using build mode with following tsdown config to build .mts files, rolldown-plugin-dts errors with a RollupError: Unable to build .d.ts file for /path/to/index.mts error.
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: 'src/index.mts',
dts: { build: true }
});🧐 Likely Cause
Under build mode, the plugin only looks for .d.ts files whereas tsc is emitting .d.mts files for .mts source files.
rolldown-plugin-dts/src/tsc/emit-build.ts
Line 74 in fbc989c
| if (outputFile.endsWith('.d.ts')) { |
⛰️ Context
Why am I running the build mode? → seemingly it is the only way to have rolldown-plugin-dts emit .tsbuildinfo files. Only incremental: true wasn't effective for this purpose.
Why do I need .tsbuildinfo files? → I want to mimic tsc behavior with tsdown so that project references properly work.
Reproduction
https://github.com/uhyo/tsdown-dmts-repro
System Info
System:
OS: Linux 6.6 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 PRO 6850U with Radeon Graphics
Memory: 11.43 GB / 15.01 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 22.20.0 - /home/uhyo/.volta/tools/image/node/22.20.0/bin/node
Yarn: 4.1.1 - /home/uhyo/.volta/tools/image/yarn/4.1.1/bin/yarn
npm: 11.4.2 - /home/uhyo/.volta/tools/image/npm/11.4.2/bin/npm
pnpm: 10.25.0 - /home/uhyo/.volta/bin/pnpm
Deno: 2.2.1 - /home/uhyo/.deno/bin/denoUsed Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Contributions
- I am willing to submit a PR to fix this issue
- I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels