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,
})
Generates this weird file name
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
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too