Skip to content

Feature request: auto-generation of "bin" field #868

@gameroman

Description

@gameroman

Clear and concise description of the problem

An option to auto-generate "bin" field, similar to how it does with "exports" field

Suggested solution

Example of how config could look

import { defineConfig } from "tsdown";

export default defineConfig({
  dts: true,

  entry: "./src/index.ts", // normal lib usage

  exports: {
    enabled: true,

    binExports: {
      tool: "./src/cli-tool.ts",
      // which would generate
      // "bin": {
      //   "tool": "./dist/cli-tool.js"
      // },
    },
  },
});

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions