Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is tsup making a declaration file with a file name I dont have #1084

Open
arthurvanl opened this issue Feb 20, 2024 · 0 comments
Open

Why is tsup making a declaration file with a file name I dont have #1084

arthurvanl opened this issue Feb 20, 2024 · 0 comments

Comments

@arthurvanl
Copy link

arthurvanl commented Feb 20, 2024

My tsup.config.ts:

import { defineConfig } from "tsup";

export default defineConfig({
    name: 'tsup',
    entry: ["src/index.ts"],
    dts: {
        resolve: true,
        entry: ['src/index.ts', "src/types/index.ts"]
    },
    splitting: false,
    clean: true,
    format: 'esm',
    sourcemap: false,
})

image
Generates this weird file name

My file structure:
image

My tsconfig:

{
  "compilerOptions": {
      "lib": [
          "ESNext"
      ],
      "module": "esnext",
      "target": "esnext",
      "moduleResolution": "bundler",
      "moduleDetection": "force",
      "allowImportingTsExtensions": true,
      "noEmit": true,
      "composite": false,
      "strict": true,
      "downlevelIteration": true,
      "skipLibCheck": true,
      "allowSyntheticDefaultImports": true,
      "forceConsistentCasingInFileNames": true,
      "allowJs": true,
      "types": [
          "bun-types" // add Bun global
      ]
  }
}

My package.json:

{
  "name": "@mintymedia/utils",
  "description": "A collection of utilities for Minty Media",
  "version": "0.0.17",
  "module": "src/index.ts",
  "type": "module",
  "main": "dist/index.js",
  "scripts": {
    "format": "bun x prettier src --write",
    "format:check": "bun x prettier src --check",
    "lint": "tsc",
    "build": "tsup",
    "test": "bun test",
    "test:watch": "bun test --watch",
    "release": "bun x changeset publish"
  },
  "license": "MIT",
  "files": ["dist"],
  "devDependencies": {
    "@changesets/cli": "^2.27.1",
    "@types/bun": "latest",
    "@typescript-eslint/eslint-plugin": "^6.19.1",
    "@typescript-eslint/parser": "^6.19.1",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-require-extensions": "^0.1.3",
    "prettier": "^3.2.4",
    "redoc-builder": "^1.1.2",
    "tsup": "^8.0.1",
    "zod": "^3.22.4"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "mysql2": "^3.9.0"
  }
}

I would like to have build the files in the following file structure:

dist

  • types
    • index.d.ts
  • index.d.ts
  • index.js

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant