Skip to content

minify, dts and outExtensions compiles definitions files in .mts #40

@victorgarciaesgi

Description

@victorgarciaesgi

Describe the bug

Hi! What a breeze to migrate from tsup to tsdown 😍

I made the migration (super simple 👌 ) on my library https://github.com/victorgarciaesgi/regle, and noticed a output problem (not breaking). I open this bug here because in the docs it says to open it here for all .d.ts related problems.

I use a mix of minify and outExtensions to output different files format.

When compiling without the outExtensions option, it correctly generated the .js and .d.ts.

Image

But when applying the options, it will try to compile the .d.mts file, resulting in an unnecessary and wrong compiled file

Image Image

In the reproduction repo (main branch)

  • pnpm install
  • pnpm run build
  • Check ./packages/core/dist

Common config for prod build is the root tsdown.common.build.ts
Config for package core project is here packages/core/tsdown.config.ts

Reproduction

https://github.com/victorgarciaesgi/regle

System Info

System:
    OS: macOS 15.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 315.06 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.14.0/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 9.7.0 - ~/.nvm/versions/node/v20.14.0/bin/pnpm
    bun: 1.0.35 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 137.0.7151.41
    Chrome Canary: 138.0.7202.0
    Edge: 136.0.3240.92
    Safari: 18.4
    Safari Technology Preview: 18.4

Used 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions