Hi!
I'm using tsup
in watch mode for a shared library in a monorepo. I can't get the d.ts generation working in watch mode.
My config
"tsup": {
"entry": [
"src/index.ts",
"src/models/index.ts",
"src/validators/index.ts"
],
"format": [
"esm",
"cjs"
],
"dts": true,
"splitting": false,
"sourcemap": true,
"clean": false
}
Output after saving a file
dev-apps-1 | @weakassdev/shared:dev: CLI Change detected: change src/example.ts
dev-apps-1 | @weakassdev/shared:dev: ESM Build start
dev-apps-1 | @weakassdev/shared:dev: CJS Build start
dev-apps-1 | @weakassdev/shared:dev: ESM dist/index.js 122.00 B
dev-apps-1 | @weakassdev/shared:dev: ESM dist/models/index.js 1.11 KB
dev-apps-1 | @weakassdev/shared:dev: ESM dist/validators/index.js 681.00 B
dev-apps-1 | @weakassdev/shared:dev: ESM dist/index.js.map 183.00 B
dev-apps-1 | @weakassdev/shared:dev: ESM dist/validators/index.js.map 1.19 KB
dev-apps-1 | @weakassdev/shared:dev: ESM dist/models/index.js.map 1.80 KB
dev-apps-1 | @weakassdev/shared:dev: ESM ⚡️ Build success in 42ms
dev-apps-1 | @weakassdev/shared:dev: CJS dist/index.cjs 2.15 KB
dev-apps-1 | @weakassdev/shared:dev: CJS dist/validators/index.cjs 3.20 KB
dev-apps-1 | @weakassdev/shared:dev: CJS dist/models/index.cjs 4.11 KB
dev-apps-1 | @weakassdev/shared:dev: CJS dist/validators/index.cjs.map 1.36 KB
dev-apps-1 | @weakassdev/shared:dev: CJS dist/index.cjs.map 283.00 B
dev-apps-1 | @weakassdev/shared:dev: CJS dist/models/index.cjs.map 2.07 KB
dev-apps-1 | @weakassdev/shared:dev: CJS ⚡️ Build success in 45ms
^ Note that this output doesn't mention dts file and when
I'm currently using tsup --onSuccess
script option to run tsc to get the d.ts files. I'd prefer a built-in solution since this requires me to align tsup and tsc config everytime I'm adding a module
"tsup": "~7.2.0",
"typescript": "~5.1.6"
Thanks!
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