Skip to content

when exports: true, subExport doesn't include type definition #253

@ryoppippi

Description

@ryoppippi

Reproduction link or steps

no reproduction.

What is expected?

Let's imagine you create an export map for unplugin.
I'd like to have the exports map with type definition

tsdown --dts --exports

generates export map like this

exports: {
    './': {
      typs: './dist/index.d.ts',
     default: './dist/index.js'
   }
}

or

exports: {
    './': {
       import: {
         types: './dist/index.d.js',
         default: './dist/index.d.js'
       },
       require: {
         types: './dist/index.d.cjs',
         default: './dist/index.cjs'
      }
   }
}

What is actually happening?

In v0.12.1

tsdown --dts --exports

generates export map like this

exports: {
    './': './dist/index.js'
}

Any additional comments?

Also I'd like to have conditional export for deno or bun
https://bun.sh/docs/runtime/modules#importing-packages

but this can be a future work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions